Jump to content

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

?> 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.