if($user_reg=="" or $pass_reg=="") {
echo "<h3> ERRER : กรุณากรอกข้อมูลให้ครบ</h3>";
exit();
}
include "connect.php";
$sql="select * from tb_employee where username='$user_reg' and password='$pass_reg' ";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows($result);
mysql_close();
if ($username=="" or $pass=="") {
echo "<h3> ERROR : You can't login.Please check your data again. </h3>";
echo "<SCRIPT LANGUAGE='JavaScript'>";
echo "backpage();";
echo "</SCRIPT>";
}else{
include "connect.php";
$sql="select * from User_Desc where Login_Name='$username' and password='$pass'";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows($result);
if($num<=0){
echo "<h3>ERROR : Username and password incorrect. Please login agine. </h3>";
echo"<center><a href='Main.php'>click here.If your browser do not work.</a></center>";
echo "<SCRIPT LANGUAGE='JavaScript'>";
echo "backpage();";
echo "</SCRIPT>";
}else{