此代码已解决,但最后一个代码中存在一些问题
$username=mysql_real_escape_string($_POST['user']);
$password=mysql_real_escape_string($_POST['pass']);
$sqlacc="SELECT * FROM members INNER JOIN accounts ON
account.mem_id =members.mem_id WHERE members.firstname='$username' and accounts.password='$password'";
$resultacc = mysql_query($sqlacc);
$countacc = mysql_num_rows($resultacc);
$rowacc = mysql_fetch_array($resultacc, MYSQL_NUM);
这是我的问题,我不知道 $_SESSION[' '] 中会放入什么字段名,
if($countacc==1){
$_SESSION[' IDONTKNOWHERE ']=$rowacc[0];
$_SESSION[' IDONTKNOWHERE ']=$rowacc[1];
header("location:content/index.php");
}
else{
header("location:login.php");
}
?>