0
我在下面的代碼中得到一個錯誤,session_register('adminuser')似乎是原因。我該如何解決這個問題?錯誤未定義的函數session_register()
// username and password sent from Form
$adminuser=mysql_real_escape_string($_POST['adminuser']);
$adminpassword=mysql_real_escape_string($_POST['adminpassword']);
$gpassword=md5($adminpassword); // Encrypted Password
$sql="SELECT id FROM admin WHERE adminuser='$adminuser' and adminpassword='$gpassword'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
// If result matched $username and $password, table row must be 1 row
if($count==1)
{
session_register('adminuser'); <--- this code causes error
header("location:index.php");
}
else
{
header("location:login.php?error=error");
您是否在頂部添加了session_start()? –
可能的重複[如何解決會議\ _register()DEPRECATED問題?](http://stackoverflow.com/questions/3682615/how-to-fix-the-session-register-deprecated-problem) – piddl0r