I created a captcha for a contact form. Everything works fine but whatever the number I enter into the captcha form it always shows invalid captcha
<?php
if(isset($_POST['norobot']))
{
if(md5($_POST['norobot']) == $_SESSION['randomnr2'])
{
ech开发者_开发技巧o "Validation Success";
$_SESSION['name'] = $name ;
$_SESSION['phone_no'] = $phone;
$_SESSION['mailid'] = $mailid;
$_SESSION['msg'] = $msg;
$_SESSION['category'] = $category;
header("Location:thankyou.php");
}
else
{
$Error = 'Invalid CAPTCHA';
}
}
}
?>
can any one say what the solution is?
How are you storing $_SESSION['randomnr2'] ? Are you md5()'ing it?
Might help to see all the code.
精彩评论