<?php
require_once('captcha.php');
session_start();
$captcha = new captcha();
$_message = '';
if(isset($_REQUEST['Submit'])){
if( $captcha->check( $_REQUEST['number'] ) ) {
$_message = '<center><font face="Verdana, Arial, Helvetica, sans-serif" color="#66CC00">Your string is valid!</font></center>';
}else{
$_message = '<center><font face="Verdana, Arial, Helvetica, sans-serif" color="#FF0000">Validation string not valid! Please try again!</font></center>';
}
}
$captcha->createCaptcha();
$_urlCaptcha = $captcha->getUrlCaptcha();
?>
<HTML>
<HEAD>
<TITLE>EASY-CAPTCHA </TITLE>
<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">
</HEAD>
<BODY onLoad="return focuson();">
<?php echo $_message ?>
<form name="form1" method="post" action="index.php">
<table width="342" align="center" cellspacing="0" bgcolor="#F2F2F2">
<tr>
<td colspan="4" align="center"><hr></td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"><img src="<?php echo $_urlCaptcha ?>"></td>
<td align="center"> </td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> Please enter the string shown in the image in the form.<br></td>
<td align="center"><input name="number" type="text" id=\"number\"></td>
<td align="center"> </td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"><input name="Submit" type="submit" value="Submit"></td>
<td align="center"> </td>
</tr>
<tr>
<td colspan="4" align="center"><hr></td>
</tr>
</table>
</form>
</BODY>
</HTML>
|