代码
<?php
ob_start();//开始缓存
session_start();
?>
<?php 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=trim($_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'];session_register("username");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>';ob_end_clean();//清除缓存
?>
运行代码居然空白