Using Captcha Images
Posted: Wed Nov 24, 2004 9:08 pm
Hey guys,
I got this code here, and right now the way it works is, when you hit
'Check It' (the button) it makes sure you have entered the proper characters to correspond with the image...Im wondering what I'd have to add to this script so that when you click -> 'Check it'
that it takes you to another page (which Ill specify in a URL)
I think I have to edit where it says:
<form action="<?echo $_SERVER["PHP_SELF"]?>" method=get>
to method post correct? then, hmm just not sure where to specify the URL, that it will take you too...any tips?
I got this code here, and right now the way it works is, when you hit
'Check It' (the button) it makes sure you have entered the proper characters to correspond with the image...Im wondering what I'd have to add to this script so that when you click -> 'Check it'
that it takes you to another page (which Ill specify in a URL)
I think I have to edit where it says:
<form action="<?echo $_SERVER["PHP_SELF"]?>" method=get>
to method post correct? then, hmm just not sure where to specify the URL, that it will take you too...any tips?
Code: Select all
<?php
<?php
/**
* The form has posted.
* Check the code which the user has entered!
*/
if(isset($_GET["code"]))
{
require "class.img_validator.php";
$img = new img_validator();
$img->checks_word($_GET["code"]);
echo "<HR>";
}
?>
<body onload="document.forms[0].code.focus();">
<form action="<?echo $_SERVER["PHP_SELF"]?>" method=get>
<img src="img.php?words=true" border=0><BR><BR>
Type the image code/word: <input type=text name=code> <input type=submit value="Check it!"><BR>Obs: It must be identical as the image (case sensitive)</form>
</body>
</html>
?>