bdavey311 Posted June 11, 2009 Share Posted June 11, 2009 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 More sharing options...
RussellReal Posted June 11, 2009 Share Posted June 11, 2009 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'); } Link to comment https://forums.phpfreaks.com/topic/161847-php-form-secure-image-help/#findComment-853894 Share on other sites More sharing options...
bdavey311 Posted June 12, 2009 Author Share Posted June 12, 2009 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'); } ?> Link to comment https://forums.phpfreaks.com/topic/161847-php-form-secure-image-help/#findComment-854170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.