就是设置不了cookie啊,
我把程序帖出来:
index.php<html>
系统登陆,数据提交给login.php
</html>login.php
<?
include "config.php";{
$str="select * from admin where name='$username' and password='$password'";
$result=mysql_query($str,db_connect()) or die(db_error());
if(!($row=mysql_fetch_array($result)))
error("对不起,用户名或密码不正确,请核对后重新登录,谢谢!");
else
{
setcookie("admin",$username);
header("location:main.php");
}
}?>
main.php<? include"checkmaster.php";?>
<html>
...........
</html>
checkmaster.php
<?
if(!($HTTP_COOKIE_VARS["admin"]))
{
header("location:index.php");
}
?>
具体就是上的东西:
问题是我用正确的用户登陆它也进不了mian.php
而还是保持在index.php
请问大家是为什么?
其实这个程序在我自己电脑成功 的,可是放别人那上面就不行了,请大家帮帮我!