<?php
session_start() ;

	if(isset($user_login) and isset($pwd_login)) {
include("config.inc.php") ;
mysql_select_db($db) ;
?>
<html>
<head>
<title>Check User</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
</head>

<body bgcolor="#FFFFCC">

<?php 

$result = mysql_query("select user,password,member_level from member where user='$user_login' and password='$pwd_login'") ;
$num = mysql_num_rows($result) ;
if($num<=0) {
echo "<br><br><center><font size='3' face='MS Sans Serif'><b>รหัสผ่านไม่ถูกต้องครับ</b></font></center>" ;
//print "<meta http-equiv=refresh content=2;URL=index.php>";
exit() ;
}
else {

$dbarr = mysql_fetch_array($result) ;
if($user_login!=$dbarr['user'] and $pwd_login!=$dbarr['password']) {
echo "รหัสผ่านไม่ถูกต้อง" ;
exit() ;
}

else {
$login_true = $user_login ;
$member_level=$dbarr['member_level'];
session_register("login_true") ;
session_register("member_level") ;
echo "<meta http-equiv='refresh' content='0 ;url=member_detail.php'>" ;
exit() ;
}
}
}
?>


</body>
</html>
