我在下面的代码中遇到错误, session_register('adminuser') 似乎是原因。我该如何解决这个问题?
// 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");