我是在win2000,环境为IIS+PHP+MYSQL,PHP的版本是4.0.6,以下是源码:
<form method="post" action="success.php">
<p>用户名:
<input name="manager_name" type="text">
<br>密码:&nbsp&nbsp
<input name="password" type="password">
</p>
<p>
<input type="submit" name="submit" value="登录">
<input type="reset" name="submit2" value="取消">
</p>
</form>seccess.php<?php
$sql="select password from managers where manager_name='$manager_name'";
require("../inc/condb.inc.php");
$result=mysql_query($sql,$db_id);
if(mysql_num_rows($result)=="")
{
echo "没有找到该用户!";
}
else if($password!=mysql_result($result,0,"password"))
{
echo "你的密码错误!";
}
else
{
session_start();
session_register("user_id");
session_register("user_password");
$user_id=$manager_name;
$user_password=$password;
Header("Location: manage.php");
}
require("../inc/closedb.inc.php");
?>

解决方案 »

  1.   

    我用的是IE5呀,错误信息如下:
    Warning: open(/tmp\sess_79d882369cc9e8721521456e340aa11e, O_RDWR) failed: m (2) in D:\music\admin\success.php on line 15Warning: Cannot add header information - headers already sent by (output started at D:\music\admin\success.php:15) in D:\music\admin\success.php on line 20Warning: open(/tmp\sess_79d882369cc9e8721521456e340aa11e, O_RDWR) failed: m (2) in Unknown on line 0Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
    我的php.ini文件中session.save_path = /tmp
    有错么?
      

  2.   

    跟浏览器没有关系可能你没有c:/tmp这个目录或者你更改session.save_path=x:/xxx
    再建立这个目录要确保一定要有合法存在的路径
      

  3.   

    跟浏览器没有关系可能你没有c:/tmp这个目录或者你更改session.save_path=x:/xxx
    再建立这个目录要确保一定要有合法存在的路径