Jump to content

PHP Form Secure Image help


bdavey311

Recommended Posts

What up!

 

The bold code is what I'm trying to implement.  If the securimage is correct I want it to load up the emailsuccess.php saying everything went well. If the securimage is false I want the emailerror.php to load up.  Pretty standard but I got nothing.

 

Little help and thanks in advance!

bD

 

 

$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

 

if ($success){

  print "<meta http-equiv=\"refresh\" content=\"0;URL=emailsuccess.php\">";

}

else{

  print "<meta http-equiv=\"refresh\" content=\"0;URL=emailerror.php\">";

}

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.');

 

?>

Link to comment
https://forums.phpfreaks.com/topic/161847-php-form-secure-image-help/
Share on other sites

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.');

} else {

  include('emailsuccess.php');

}

Thanks for the reply but I'm still have problems.  If i put your code in it will still send the email and go to the success page without needing the secure image letters.  Am I missing something?


$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=emailsuccess.php\">";
}


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.');
} else {
  include('emailsuccess.php');
}

?> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.