This is the code for teachercheck.php
<head>
<base target ="_top">
<title>Login Guru</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?
session_start();
$hostname = "127.0.0.1";
$password ="";
$user = "";
$db="school";
/ Establish our connection to the DB. /
mysql_pconnect($hostname,$user,$password) or die("Unable to connect to SQL
server");
mysql_select_db($db) or die("Unable to select database");?>
<?$result = mysql_query("select from details where teacherid like '$userid'");
if (mysql_num_rows($result) != 0){
$pass = mysql_db_query("select from details where userid like '$userid' and password like '$pass_word'");
$numpass = mysql_num_rows($pass);
if ($numpass != 0){header("Location:127.0.0.1/tindex.php?teacherid=".$userid);
exit;
}
else
echo("Kata Laluan anda salah. Sila cuba sekali lagi.");
}
if (mysql_num_rows($result) == 0){echo("Anda masih belum didaftarkan");}
?>
</body>