错误提示
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /test/index.php:8) in /test/inc.php on line 2其中index.php:8 这个:8什么意思?inc.php 代码如下:
<head>
<META HTTP-EQUIV=REFRESH CONTENT='0;URL=http://localhost/test/inc.php?login=1'>
</head><?php
session_start(); index.php 头几行代码如下:<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>测试</title><link href="css/css.css" rel="stylesheet" type="text/css">
</head>
<?
include "../../../inc.php";
?>我是新手刚学php,看不懂提示,请教大家哪里有session_start输出错误?
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /test/index.php:8) in /test/inc.php on line 2其中index.php:8 这个:8什么意思?inc.php 代码如下:
<head>
<META HTTP-EQUIV=REFRESH CONTENT='0;URL=http://localhost/test/inc.php?login=1'>
</head><?php
session_start(); index.php 头几行代码如下:<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>测试</title><link href="css/css.css" rel="stylesheet" type="text/css">
</head>
<?
include "../../../inc.php";
?>我是新手刚学php,看不懂提示,请教大家哪里有session_start输出错误?
里面有个session 什么的 设为 on 应该就行了
<META HTTP-EQUIV=REFRESH CONTENT='0;URL=http://localhost/test/inc.php?login=1'>
</head> <?php
session_start(); session_start 前不允许有输出
红色部分不是输出吗
在index.php文件代码中第八行
<META HTTP-EQUIV=REFRESH CONTENT='0;URL=http://localhost/test/inc.php?login=1'>
</head>去掉还是报输出错误
或者把把session_start()去掉再把php.ini里的session.autostart=1
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>测试 </title> <link href="css/css.css" rel="stylesheet" type="text/css">
</head>
这段去掉就可以了,但是title标签去掉就没法编辑了啊,网页标题是空的
<?php
session_start();
?>
content
<?
include "../../../inc.php";
?>
这段放不了最前面,每次保存都自动跳到标签后面,标签留着就报session输出错误,去掉就没报错,但是去掉的话title就没法编辑了
source1:
//验证登陆
if (CheckLogin($_POST["uname"],$_POST["pwd"])){
//成功登陆
$_SESSION["T_uname"] = $_POST["uname"];
echo "<script>alert('登陆成功!".$dt."');</script>";
}else {
//登陆失败
echo "<script>alert('用户名密码错误!".$dt."');window.location.href='index.php'</script>";
}
source2://判断会话信息是否为空
if ($_SESSION["T_uname"] == null){
echo "<script type='text/javascript'>alert('对不起,请先登陆!'); window.location.href = 'Index.php';</script>";
}这个代码 哪里有问题啊 ,我晕 跳转页面后Session就丢失了!!!等