Blog | Technical
I was needing to integrate an `im not a robot` script into my forms and looked at Google`s recptcha functions.
However, I had some difficulty with integration as I wanted to use it in an Ajax environment. Therefore I looked at creating a new solution.
This script is now completed and working fine.
form.phpThis code contains the initial tick box to select "I am a Robot" function call. `$aj` is the code required for the ajax event onclick to call the iRobot function. The response returned will be placed in the slot robot_check_id.
return false; \" " ;
print "< span id=\"robot_check_id\" >< input type=\"Checkbox\" name=\"$name\"
style=\"transform:scale(2); " $aj; required >< /span >I am not a robot " ;
iRobot.phpThe purpose of this function is to inject a hidden value onto your form, this will contain a secure secret key which will then be loaded with the form. You can work out this secret code to suit yourself, say based on session and a secure_key that you provide.
echo "< input type=\"hidden\" name=\"KEY\" value=\"$KEY\" / >";
iRobot.jsThis file is the Ajax function call that allows the event to call the php server side function, the response will echo secret data onto your form (to be used in the form submission).
I`ll provide a full link to working example shortly.
Please contact me on above link if you have any questions.