每次登录时,密码都会从数据库中删除。其余数据完好无损。我是网络编程的初学者,对此我一无所知。这可能是什么原因?
[从评论中复制的代码]
$user= $_POST['username'];
$pass = $_POST['password'];
if((isset($user))&&(isset($pass))) {
$query ="Select password from table1 where user_name='".$user."'";
$result = mysql_query($query) or die();
$r= mysql_fetch_assoc($result) or die();
if(!strcmp($pass, $r)) {
echo "succesful";
session_start();
$_SESSION['username']=$user;
$_SESSION['logged']=1;
header("Refresh: 0; URL = ..\home\index.php");
}
}