开发者

Why does my CAPTCHA code fail?

开发者 https://www.devze.com 2023-02-04 14:36 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号