Here it is, an AJAX’d contact form with a captcha. I had an idea to code this about a week ago and thought would be a tough job to do but it wasn’t that tough to code when I started doing it. The only place where I had to spend a lot of time was, pondering how to pass the value from the ‘textarea’ to the PHP preserving the line breaks. After googling for about an hour and reading different articles I finally got what was required, I just had to escape(): the variable before sending it to the PHP script.
On a positive note, I didn’t really have any problem with running this script on IE (I usually have to break my head over this matter). To prelude its features, I guess it does everything you’d normally except a contact form to do. It sanitizes all the variables, checks for the Email structure and disabled the submit button once the email is sent to prevent mass emails. I would like to thank SecondVersion and Psyrens for the PHP backend & ajax captcha respectively. As usual I’m lazy to provide a detailed documentation about it and would *make sure* that I write one in the future. But the whole script isn’t obfuscated at all, you’d just have to edit some constants and woo! it’s done.
I’m currently working on integrating this script as a wordpress plugin. Please let me know any bugs/commments/feedback by commenting below or contacting me. Show-off your own modified version of this script here
Script Demo : http://hakc.net/ajax-contact-form-captcha-demo/
Script Download : http://hakc.net/…./….zip