<?php
if (isset ( $_REQUEST ['authcode'] )) {
session_start ();
if ($_REQUEST ['authcode'] == $_SESSION ['authcode']) {
echo '<font color="#0000CC">输入正确</font>';
} else {
echo '<font color="#CC0000"><b>输入错误</b></font>';
}
exit ();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>验证码</title>
</head>
<body>
<form method="post" action="./form.php">
<p>
验证码:<img border="1" src="./captcha.php?r=<?php echo rand();?>"
width="100px" height="30px" />
</p>
<p>
请输入验证码:<input type="text" name="authcode" />
</p>
<p>
<input type="submit" value="提交" style="padding: 6px 20px;" />
</p>
</form>
</body>
</html>