关键时刻出现了一点小问题 求高手
[code=PHP][/code]
ession_start() [function.session-start]: Cannot send session cache limiter - headers already sent 出现了这样的一个情况 请问这个是什么情况
<?php session_start();
include("conn.php");
$username = trim($_POST['username']);
$paw = md5(trim($_POST['paw']));
$post=$_POST['check'];
$errmsg = '';
if (!empty($username)) {
if (empty($username)) {
$errmsg = '数据输入不完整';
}
if(empty($errmsg)) {
if (mysqli_connect_errno()) {
$errmsg = "数据库连接失败!\n";
}
else {
$sql = "SELECT * FROM user WHERE username='$username' AND pwd='$paw'";
$result = mysql_query($sql);
if ($result && mysql_num_rows($result) > 0 && $post==$_SESSION[check_pic]) {
echo "<script>alert('登陆成功');window.location.href='../admin/index.php'</script>";
}else {
echo "<script>alert('用户名或者密码和验证码不正确');window.location.href='login1.php'</script>";
}
mysql_free_result($result);
mysql_close($db);
}
}
}
?>
这个是程序的代码
------解决方案--------------------
<?php 前面不能有输出,包括空格空行还有utf-8编码下的BOM头。