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>
';

}
?>

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

  • 2 years later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.