Trizen Posted November 26, 2009 Share Posted November 26, 2009 Ok i would like to change this ever so slightly to not only go back to the page i need but also display a message in a popup or on the page somewhere that they entered an invalid security code. im at a loss. i might just be im trying to do this at 4 in the morning... include_once $_SERVER['DOCUMENT_ROOT'] . '/webdevolpments/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 (header("Location: http://webdevolpments.com/?p=join")); Thanks for your help in advance Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/ Share on other sites More sharing options...
garethhall Posted November 26, 2009 Share Posted November 26, 2009 This will probably give you an error but worth a try. I suspect you will get a header already sent error. If you do then perhaps ajax is the answer. <?php include_once $_SERVER['DOCUMENT_ROOT'] . '/webdevolpments/securimage/securimage.php'; $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { ?> <script>alert("Wrong code!")</script> <?php die (header("Location: http://webdevolpments.com/?p=join")); } Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/#findComment-965896 Share on other sites More sharing options...
Trizen Posted November 26, 2009 Author Share Posted November 26, 2009 that gave me an error... Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/#findComment-965897 Share on other sites More sharing options...
Trizen Posted November 26, 2009 Author Share Posted November 26, 2009 anyone got any ideas, i tried the http_referer but i got errors on that too. Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/#findComment-965905 Share on other sites More sharing options...
premiso Posted November 26, 2009 Share Posted November 26, 2009 that gave me an error... Wow that is really helpful. So in order to solve your issue we have to convey our telepathic skills? What was the error given, and maybe you can get some help. Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/#findComment-965967 Share on other sites More sharing options...
Trizen Posted November 26, 2009 Author Share Posted November 26, 2009 ok so your going to flame me about telepathy cause your not sherlock holmes... pay attention to the differences and maybe you wouldnt find the need to act like a douche and make other mad. Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/#findComment-966035 Share on other sites More sharing options...
MisterWebz Posted November 26, 2009 Share Posted November 26, 2009 ok so your going to flame me about telepathy cause your not sherlock holmes... pay attention to the differences and maybe you wouldnt find the need to act like a douche and make other mad. When you don't even bother posting the error, why should we bother to help you? edit: <?php include_once $_SERVER['DOCUMENT_ROOT'] . '/webdevolpments/securimage/securimage.php'; $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { header("Location: error.php") } ?> You mean something like this? Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/#findComment-966056 Share on other sites More sharing options...
Trizen Posted November 26, 2009 Author Share Posted November 26, 2009 ok i got a header error because it says that there was already a header output. anyways sorry for going off, i was up till 5 in the morning and had to get up to go see the folks. but i was responding the post before mine which the guy posted about the alert script added to my existing script which he said it would most likely give me an error which i was just confirming for him. Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/#findComment-966104 Share on other sites More sharing options...
Trizen Posted November 26, 2009 Author Share Posted November 26, 2009 i got it i used the <?php include_once $_SERVER['DOCUMENT_ROOT'] . '/webdevolpments/securimage/securimage.php'; $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { header("Location: captcha_error.php") } ?> then made captcha_error.php like this <?php echo ("<script>alert('Incorrect Security Code Entered')</script>"); ?> <script type="text/javascript"> <!-- window.location = "http://webdevolpments.com/?p=join" //--> </script> now it notifies them they input the incorrect code and sends them back to the page. Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/#findComment-966107 Share on other sites More sharing options...
premiso Posted November 27, 2009 Share Posted November 27, 2009 ok so your going to flame me about telepathy cause your not sherlock holmes... pay attention to the differences and maybe you wouldnt find the need to act like a douche and make other mad. Flaming you huh? For not posting the error? I see no where that you stated the error at all, I saw someone guess the error...but if you want help try providing decent information and you will actually get decent help. Posting: I have an error, Fix it. Is being a douche way more, as you are basically telling us to look for your issue and solve it instead of providing us with everything you can to help us help you. But it is all good man, I will just stay away from your posts. Have a good one. Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/#findComment-966259 Share on other sites More sharing options...
Trizen Posted November 27, 2009 Author Share Posted November 27, 2009 yo read my post i said sorry. Quote Link to comment https://forums.phpfreaks.com/topic/183009-popup-error-message/#findComment-966292 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.