I have the following PHP script, But it seems to be always checking for the session and therefore echos out “please enter the correct code before the user has even entered a code.
I would like to at a click event before the code actually fires and does the check for the session and post of the form. How can this be done in PHP?
here is my code:
<?php
session_start();
if (md5($_POST['norobot']) == $_SESSION['randomnr2'])
{
// here you place code to be executed if the captcha test passes
echo "Code correct - email should send now";
}
else {
// here you place code to be executed if the captcha test fails
echo "Code incorect please try again";
}
?>
my submit buttons looks like this:
<input type="submit" id="submit_btn" class="button" value="Submit" />
1 Answer