这是代码。abc_university 是我的数据库名称。
<?php
include('connectionfile.php');
$query=("select username,password from professor where username='$_POST[username]'AND password='$_POST[password]'");
$result=MYSQL_QUERY($query);
$number = abc_university_numrows($result);
if($number ==0)
{
abc_university_close($id_link);
header("Location:InvalidUser.php");
}
else if($number ==1)
{
$user=$_POST['username'];
$pwd=$_POST['password'];
session_start();
session_register("user");
if(!isset($_POST['user']))
{
$_SESSION['user'] = $prof_email_id;
$_SESSION['pwd'] = $prof_pwd;
}
abc_university_close($id_link);
header("Location:UserPage.php");
}
else
{
abc_university_close($id_link);
header("Location:InvalidUser.php");
}
?>