Captcha image verification

posted on June 24, 2006, 12:47 am
Comments
Mike de la Flor posted on October 24, 2006, 1:27 pm
Hello,

I have the script working but I wanted it to go to my thank you page when successful. The post by Andrew asks the same question. The answer was ("Location: thankyou.html") but where do I put that? Can you please post the submit.php scritp with the Location: thankyou.html in the correct place?

Thanks,
Mike

------------------------------
Veselin: it should look like this
<?
session_start();
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='') {
echo '<strong>Incorrect verification code.</strong><br>';
} else {
header("Location: thankyou.html");
};
?>

------------------------------
Mike: THANK YOU! I am now attempting to combine the captcha scripts with the PHP contact form. I may need some help....let's see what happens.

Chris posted on October 14, 2006, 3:43 am
Nice script! Can you make it display letters as well in the random code?
---------------------------------
PHPJabbers: you can define an array with symbols that you want to use and then select random array elements instead of using rand(10000,99999);

BKerr posted on October 1, 2006, 2:39 pm
Im having trouble increasing the fontsize, i tried just changed the variable to a larger number but it didnt work? Any way to do this?
---------------------------------
PHPJabbers: can you show us the code that you use.

james posted on September 6, 2006, 4:39 am
hello, can some one combine contact form and this captcha script into one script? i;m new in programming, kind of confuse now
what i mean is the contact form in : http://www.phpjabbers.com/make-contact-form-and-send-email-in-php-php21.html
thx
james
---------------------------------
PHPJabbers: yes, we can combine this for you. However, we will require a small fee for doing this.

rocks posted on September 1, 2006, 12:48 pm
Thank's for your nice code example. It helped me a little bit, but i would like to have such a function in my OOP file and it should be posted by the same page where the form itself stands. I'v tried to do it so, but everytime when i submit a value, then the comparison of two variables in the session and post will not be equal and i think that it's because of that after a click on the submit button the session variable will change.? Is my opinion correct? What should i do to have a right action to be done?
I'll hope You can help me a little.
---------------------------------
Veselin: I understand that you want the captcha verification code to be in the same page where the form is. If this is so you can just add this code to the captcha.php script so it creates a session variable if it has not done so.
if ($_SESSION['vercode']<>'') {
&nbsp;&nbsp;&nbsp;$text = rand(10000,99999);
&nbsp;&nbsp;&nbsp;$_SESSION['vercode'] = $text;
} else {
&nbsp;&nbsp;&nbsp;$text = $_SESSION['vercode'];
};

Andrew posted on August 24, 2006, 3:07 am
I got it to work but I would like it to got to a page on my site to say thank you how do I do that?
---------------------------------
Veselin: you can use a header("Location: thankyou.html") redirect or a javascript redirect.

lavercq posted on July 30, 2006, 11:59 am
Hello,
I tried your captcha, but I can't make it worked...
It only display a new number each time I click but the form does not appear on the screen, so impossible to verify...
Porbably I do not understand correctly how to do.
Thank's for your generosity.
---------------------------------
Veselin: send me the URL to your web form and I will check it.
---------------------------------
lavercq: thanks for your help. It worked great !

Pages:   1   2   3   4   5   6   7   8   9   10   11   
   
If you have any additions, suggestions or modifications for this example please contact us or use the form below.
   
Your name:
Your email: (email address will not be posted on the web site)
Comment:
Verification