Need hand in the right direction Using a ajax contact form but it doesnt have caphta Trying to add this captcha code http://www.phpcaptcha.org/documentation/quickstart/ to this Ajax contact form http://www.dustindiaz.com/ajax-contact-form/ added <img id="captcha" src="/securimage/securimage_show.php" alt="CAPTCHA Image" /> <input type="text" name="captcha_code" size="10" maxlength="6" /> <a href="#" onclick="document.getElementById('captcha').src = '/securimage/securimage_show.php?' + Math.random(); return false">Reload Image</a> the image appears and I can refresh it ok the form using contact.php to process the form so I added <?php session_start(); ?> include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php'; $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { // the code was incorrect // handle the error accordingly with your other error checking // or you can do something really basic like this die('The code you entered was incorrect. Go back and try again.'); } Issue is its not even looking at the captcha code. I checked the source of the contact form and I can see a session var either? Pulling my hair out could some one please assist me?
Hello, I am not getting your problem. Can you provide more details.? If you are looking for session variable for captcha then it is $_SESSION['securimage_code_value'] Code (markup):
sorry what I mean is when I try to implement the captahc into the ajax contact form I don't see a session variable in the source as per the demo. not sure if this is the actual issue. I need some one to tell me where the error checking is to put the last two lines of code. Each time I try to add the code it seems to ignore the include and carry on posting the message I am getting slammed spam wise.