Jump to content

popup error message


Trizen

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.