Fly_Lollipop
2020-06-03 17:39
<?php
session_start();
if (isset($_REQUEST['authcode'])) {
if ($_REQUEST['authcode'] == $_SESSION['AUTHCODE']) {
echo '<font color="green">验证成功</font>';
} else {
echo '<font color="red">验证失败</font>';
}
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>验证页面</title>
</head>
<body>
<form method="post" action="./index.php">
<p>
验证码内容: <img id="point" border="1" src="./point.php?r=<?php rand();?>"
width="200" height="60">
</p>
<a href="javascript:viod(0)"
onclick="document.getElementById('point').src='./point.php?r='+Math.random()">看不清?</a>
<p>
请输入验证码:<input type="text" name="authcode" value="" />
</p>
<p>
<input type="submit" value="提交" style="padding: 6px 20px">
</p>
<p>
<input type="text" value="<?php echo $_SESSION['AUTHCODE'] ?>">
</p>
</form>
</body>
</html>
解决了没
PHP实现验证码制作
37916 学习 · 321 问题
相似问题