Jump to content

Need a very simple captcha tool


Omzy

Recommended Posts

I'm using WAMPserver2 on Windows XP SP3

 

i tweaked the code due to the time() being in a script and added isset for the sessions,

however i have not had a page expire yet!

 

My form2.php code

 

<?php
session_start();
if(isset($_POST['submit']) && isset($_SESSION['security_code']) && $_SESSION['security_code'] == $_POST['security_code'])
{
echo 'Thank you. Your message said "'.$_POST['message'].'"';
unset($_SESSION['security_code']);
}else{
if(isset($_POST['security_code']) && isset($_SESSION['security_code']) && $_SESSION['security_code'] != $_POST['security_code'])
{
	echo 'Sorry, you have provided an invalid security code';
}
echo '
<form action="form2.php" method="post">
  <label for="name">Name: </label><input type="text" name="name" id="name" /><br />
  <label for="email">Email: </label><input type="text" name="email" id="email" /><br />
  <label for="message">Message: </label><textarea rows="5" cols="30" name="message" id="message"></textarea><br />
  <img src="captcha.php?width=100&height=40&characters=5&'.time().'" /><br />
  <label for="security_code">Security Code: </label><input id="security_code" name="security_code" type="text" /><br />
  <input type="submit" name="submit" value="Submit" />
</form>
';

}
?>

Link to comment
Share on other sites

I've got a manual set up on my Windows Vista machine, consisting of Apache 2.2, PHP5 and MySQL 5

 

Did you definitely try the test by entering an incorrect code? I.e. steps to reproduce:

 

1) Enter incorrect code

2) Form should re-display, enter the correct code

3) Confirmation message displayed

4) Hit the back button and page has expired

 

I don't suppose it could any setting in the php.ini or httpd.conf file?

 

EDIT: Same result also in Windows XP SP3 / IE7

Link to comment
Share on other sites

  • 2 years later...
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.