这段代码为什么不能设置cookie

@Ta 2015-08-11 2812点击
<?php
$title="注册";
include("../head.php");
include("../conn.php");
include("../function.php");
$ok=isapp;
setcookie('app',$ok,time()+31536000);
$sid=sqlstr($_COOKIE['user']);
$user=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));
if($user){
header("Location:/user/user.php");
exit;
}
if(!$user){
header("Location:/index.php");
exit;
}
?>
回复列表(6|隐藏机器人聊天)
添加新回复
回复需要登录