求救,关于PHP的登入次数系统问题。 (紧急) if($loginErrorV){ if(isset($_COOKIE['login'])){ if($_COOKIE['login']<3){ header('Location:login.php'); $attempts = $_COOKIE['login'] + 1; } else { header('Location:register.php'); } }}你不是已經寫好了嗎 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 原來你沒有set cookie,所以不行。if($loginErrorV){ if(isset($_COOKIE['login'])){ if($_COOKIE['login']<3){ setcookie("login",$_COOKIE['login'] + 1, time()+3600*24); header('Location:login.php'); $attempts = $_COOKIE['login'] + 1; } else { header('Location:register.php'); } }else{ setcookie("login",0, time()+3600*24); }} cookie也可以实现,if (isset($_COOKIE['user']) && isset($_COOKIE['login_times'])) { setcookie("login_times", $_COOKIE['login_times']+1, time()+3600); echo $_COOKIE['user'] . "<br/>"; echo $_COOKIE['login_times']; if ($_COOKIE['login_times'] > 3) { setcookie("user", "", time()-3600); setcookie("login_times", "", time()-3600); header("Location:user.php?act=register_page"); } } else { setcookie("user", $user_arr[0]['user_name'], time()+3600); setcookie("login_times", 1, time()+3600); }如果需要行为分析:可以用一个新表来记录用户的登录和注册行为 对于系统的分析和统计会更好CREATE TABLE `user_log` ( `id` int(6) NOT NULL AUTO_INCREMENT, `user_id` int(6) NOT NULL, `user_action` int(1) NOT NULL, PRIMARY KEY (`id`)) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8加上时间字段,登录失败,在一定时间范围内锁定账号,统计查询失败次数,登录失败新增对应记录 php中怎么调用swf文件 哪位大哥能帮帮我啊??? <?php echo $rs->Email?> 论坛速度好慢啊,CSDN管理人员想想办法啊??? 如何用PHP把1000多个.txt文件导出到MYSQL数据库 求一个功能的实现方法 <input type="file" 和<input type="hidden"同时提交怎么提取? 请问有没有类似百度知道这类型的php程序? 求教大神一个问题 PHP socket怎么模仿微信群聊 php正则排除某些字符 求朋友指点淘宝订单合并,快递单号推送接口问题
if($loginErrorV){
if(isset($_COOKIE['login'])){
if($_COOKIE['login']<3){
setcookie("login",$_COOKIE['login'] + 1, time()+3600*24);
header('Location:login.php');
$attempts = $_COOKIE['login'] + 1;
} else {
header('Location:register.php');
}
}else{
setcookie("login",0, time()+3600*24);
}
}
setcookie("login_times", $_COOKIE['login_times']+1, time()+3600);
echo $_COOKIE['user'] . "<br/>";
echo $_COOKIE['login_times'];
if ($_COOKIE['login_times'] > 3) {
setcookie("user", "", time()-3600);
setcookie("login_times", "", time()-3600);
header("Location:user.php?act=register_page");
}
} else {
setcookie("user", $user_arr[0]['user_name'], time()+3600);
setcookie("login_times", 1, time()+3600);
}如果需要行为分析:可以用一个新表来记录用户的登录和注册行为 对于系统的分析和统计会更好
CREATE TABLE `user_log` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`user_id` int(6) NOT NULL,
`user_action` int(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8
加上时间字段,登录失败,在一定时间范围内锁定账号,统计查询失败次数,登录失败新增对应记录