解决方案 »
- 用phpmyadmin 导入CSV文件 中文是乱码
- 高手来这边拿分,上传文件时报错:open_basedir restriction in effect
- 为什么加else会报错啊?去掉else正常输出,
- 表单提交到另一个php页面,如何保存获取表单值
- [問題]textarea回車符的問題
- 文件内容排序(十万火急)
- 玩了玩个人资料,里面有个 特长选择,竟然没有php选项,请版主向高层传达草根的呼吸……
- 公交搜索网上线,隆重送分!!!
- 大家怎么处理程序终止退出?用exit的话,网页后半段的内容(比如底部)也出不来。
- ◇◆php读取记录错误!!◇◆
- 请问一个学习的问题
- 大家谁用过eyeOS 2.x的进来贴吧
function ckcookie($user,$password)
{ $rs=mysql_fetch_array(mysql_query("select * from user")) or die(mysql_error());//sql中 的where条件呢????????????
if($user == $rs[name] && $password == $rs[password])
{
echo "<script>alert('Login Success!');location.href='a_index.php';</script>";
}
else
{
echo "<script>alert('Login Bad!');location.href='index.php';</script>";
exit;
} }
{ $rs=mysql_fetch_array(mysql_query("select * from user")) or die(mysql_error());//'select * from user where username = "$user" and password = '"'.md5($password).'"'
if($user == $rs[name] && $password == $rs[password])
{
echo "<script>alert('Login Success!');location.href='a_index.php';</script>";
}
else
{
echo "<script>alert('Login Bad!');location.href='index.php';</script>";
exit;
} }
cookie本来就应该是第二次开始才生效的
function post()
{
if(isset($_POST['user']) && isset($_POST['password']))
{
$user = $_POST['user'];
$password = $_POST['password'];
$rs=mysql_fetch_array(mysql_query("select * from user")) or die(mysql_error());
if($rs[name] === $user && $rs[password] === md5($password))
{
setcookie("user",$user,time()*24*60*60);
setcookie("password",md5(trim($password)),time()*24*60*60);
echo $_COOKIE['user'].'-'.$_COOKIE['password'];exit;//这块输出下看看是否成功了
info("Login Success!",'a_index.php');
}else{
info("Login Bad!",'index.php');
}
}
}
<form name="login" action="
Warning: Cannot modify header information - headers already sent by (output started at C:\wwwroot\cf\admin\index.php:11) in C:\wwwroot\cf\appl\model\checklogin.php on line 17Warning: Cannot modify header information - headers already sent by (output started at C:\wwwroot\cf\admin\index.php:11) in C:\wwwroot\cf\appl\model\checklogin.php on line 18
-
也不能出现HTML页面的输出。
就一个类,下面就是function...这个页面也没有调用其它页面了
就一个类,下面就是function...这个页面也没有调用其它页面了
就一个类,下面就是function...这个页面也没有调用其它页面了
我都没看header语句在哪里。
是的话,要把BOM头取消了,不要保存带头的文件.
function post()
{
if(isset($_POST['user']) && isset($_POST['password']))
{
$user = $_POST['user'];
$password = $_POST['password'];
$rs=mysql_fetch_array(mysql_query("select * from `user` where `name` = '$user'")) or die(mysql_error());
if($rs['password'] == md5($password))
{
setcookie("user",$user,time()+24*60*60);//设置cookie时效,是当前时间加上时效时间,你的是用的*号,应该为+
setcookie("password",md5(trim($password)),time()+24*60*60);
info("Login Success!",'a_index.php');
}else{
info("Login Bad!",'index.php');
}
}
} /**
* 判断是否获取COOKIE
*/
function ckcookie($user,$password)
{ $rs=mysql_fetch_array(mysql_query("select * from `user` where `name` = '$user'")) or die(mysql_error());
if($rs['password'] == md5($password))
{
echo "<script>alert('Login Success!');location.href='a_index.php';</script>";
}
else
{
echo "<script>alert('Login Bad!');location.href='index.php';</script>";
exit;
} }
也没有看到你在哪里设置了 cookie