这可能看起来像标准问题,但事实并非如此。我收到此错误:
session_start() [function.session-start]:无法发送会话缓存限制器
....这就是我无法理解的,因为session_start()
是文件中写入的第一件事(除了<?php
)。这是代码:
<?php
session_start();
include "config.php";
$escapedName = mysql_real_escape_string($_GET['email']);
$escapedPW = mysql_real_escape_string($_GET['password']);
$query ="SELECT salt FROM users WHERE email='".$escapedName."'";
$result = mysql_query($query, $link) or die ("SQL dotaz sa nepodaril");
$num = mysql_num_rows($result);
while ($row=mysql_fetch_array($result)){
$salt = $row["salt"];
}
$saltedPW = $escapedPW . $salt;
$hashedPW = hash('sha256', $saltedPW);
//echo $hashedPW."<br>";
$query ="SELECT ESN_WINGS_ID as id FROM users WHERE email='".$escapedName."' AND password='".$hashedPW."'";
$result = mysql_query($query, $link) or die ("SQL dotaz sa nepodaril");
$num = mysql_num_rows($result);
if($num == 0)
echo "Invalid e-mail or password";
while ($row=mysql_fetch_array($result)){
$_SESSION["id"] = $row["id"];
echo $SESSION["id"]."NOT WORKING!";
//echo $row["id"];
}
?>
感谢您的回复。