但是应该是后台提交一次,tmp里只有一个呀?而且我登入不进后台,经测试
<?
include "../inc/global.php";
//////// die($_SESSION["s_id"]); 这里不能得到值为1。if(isset($HTTP_POST_VARS["login"])){
if(empty($_POST[administrator])) die("请填写管理员名称");
if(empty($_POST[password])) die("请填写管理员密码"); $query = mysql_query("select * from editor where name='$administrator' and passwd='$password' and status=1");
if(!mysql_num_rows($query)) die("密码验证错误或帐号已被注销"); $row = mysql_fetch_array($query);
$s_id = $row[eid];
$s_name = $row[name];
session_register("s_id");
session_register("s_name");
//////// die($_SESSION["s_id"]); 这里能得到值为1。
?>
<Script>window.location="index.php";</script>
<?} else if($_SESSION["s_id"]) {
?>
<Script>window.location="welcome.php";</script>
<?
} else {
// 显示登录窗口}?>
<?
include "../inc/global.php";
//////// die($_SESSION["s_id"]); 这里不能得到值为1。if(isset($HTTP_POST_VARS["login"])){
if(empty($_POST[administrator])) die("请填写管理员名称");
if(empty($_POST[password])) die("请填写管理员密码"); $query = mysql_query("select * from editor where name='$administrator' and passwd='$password' and status=1");
if(!mysql_num_rows($query)) die("密码验证错误或帐号已被注销"); $row = mysql_fetch_array($query);
$s_id = $row[eid];
$s_name = $row[name];
session_register("s_id");
session_register("s_name");
//////// die($_SESSION["s_id"]); 这里能得到值为1。
?>
<Script>window.location="index.php";</script>
<?} else if($_SESSION["s_id"]) {
?>
<Script>window.location="welcome.php";</script>
<?
} else {
// 显示登录窗口}?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货