<!--提交菜单-->
<?php
if(isset($_REQUEST['authcode'])){
session_start();
if($_REQUEST['authcode']==$_SESSION['authcode']){
echo "输入正确";
}
else{
echo "输入错误";
}
exit();
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8||GBK">
<title>验证码的实现</title>
</head>
<body>
<form name="form" action="./form.php"method='post'>
<table>
<tr>
<td width="200" height="50"cellspacing="0" cellpadding="0"border="1">
<td>验 证 码: <img border="1"src="./captcha.php? r=<?php echo rand();?>"width="160px" height="25px"></td>
</td>
</tr>
<tr>
<td width="200" height="50"cellspacing="0" cellpadding="0"border="1">
<td>请输入图片的内容:<input name="text"type="text"value=""/></td>
</td>
</tr>
</tr>
<td width="200" height="50"cellspacing="0" cellpadding="0"border="1">
<td><input name="submit"type="submit"value="提交"style="padding:2px 24px;"></td>
</td>
</tr></table>
</form>
</body>
</html>
<!--form菜单-->
<?php
if(isset($_REQUEST['authcode'])){
session_start();
if($_REQUEST['authcode']==$_SESSION['authcode']){
echo "输入正确";
}
else{
echo "输入错误";
}
exit();
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8||GBK">
<title>验证码的实现</title>
</head>
<body>
<form name="form" action="./form.php"method='post'>
<table>
<tr>
<td width="200" height="50"cellspacing="0" cellpadding="0"border="1">
<td>验 证 码: <img border="1"src="./captcha.php? r=<?php echo rand();?>"width="160px" height="25px"></td>
</td>
</tr>
<tr>
<td width="200" height="50"cellspacing="0" cellpadding="0"border="1">
<td>请输入图片的内容:<input name="text"type="text"value=""/></td>
</td>
</tr>
</tr>
<td width="200" height="50"cellspacing="0" cellpadding="0"border="1">
<td><input name="submit"type="submit"value="提交"style="padding:2px 24px;"></td>
</td>
</tr></table>
</form>
</body>
</html>
打开App,阅读手记