<?
$host="localhost";
$username="root";
$pass_word="";
$db="";
$tb="";
mysql_connect( $host,$username,$pass_word) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้");
$pass_login=md5($pass); // เข้ารหัส Md5
$sql = "select * from $tb where user='$user' and pass='$pass_login'";
$incount_new=$incount+1;
$sql="update $tb set incount='$incount_new',last_login='$last_login' where user='$user' and pass='$pass_login'";
$dbquery=mysql_db_query($db,$sql);
Session_register("user");
header('location:profile.php');