php 实现三次登陆失败出现验证码并验证
发布网友
发布时间:2022-04-06 01:57
我来回答
共1个回答
热心网友
时间:2022-04-06 03:27
<form action='login.php' method='post'>
<input name="user" type="text" size="20" ><br><br>
<input name="pass" type="password" size="22" ><br><br>
<input name="checkin" type="submit" value="登陆系统">
</form>
login.php
$_COOKIE['num'] = 0;
if($_COOKIE['num']==3){
header("Location:index.php");
}else{
$user = $_POST['user'];
$pwd = $_POST['pass'];
$sql = 此处省略用户登录判断
//如果判断用户登录失败$_COOKIE['num']++;
header("Location:login.php");
}