只会用会话 cookie第一次用 居然Fatal error : Call to undefined function setcookie() in /home/u370929193/public_html/lx/dl.php online 10 求纠正
<?php
setcookie("$username");
echo <<<文件头
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "
http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="application/xhtml xml; charset=utf-8"/><title>登陆</title></head><body>
文件头;
$name=$_POST['name'];$pass=md5($_POST['pass']);if($name and $pass){
include('con.php');$sql="SELECT * FROM user
WHERE name='$name'";$b=mysql_query($sql);$row=mysql_fetch_array($b);$user=$row['name'];$passd=$row['password'];if($name!=$user){
echo'用户不存在';}elseif($pass!=$passd){echo'密码错误';}else{$username=$_POST['name']; setcookie("$username","",time()+3600);
header("Location:index.php");}}else{ echo <<<登录
<form method="post" action="dl.php">用户名<br><input type="text" name="name" /><br>密码<br><input type="password" name="pass" /><br><input type="submit" name="sub"value="登陆" /></form>
登录;
}
echo'</body></html>';
?>