Phần 3 đăng nhập
<body>
<?php
include('Connection.php');
if(isset($_POST['btn_log']))
{
$t1=$_POST['t1'];
$t2=md5($_POST['t2']);
$sq="select * from customer where username='$t1' and password ='$t2'";
$result= mysql_query($sq);
if(mysql_num_rows($result)>0)
{
echo "<script>alert('login success');</script>";
echo '<meta http-equiv="refresh" content="0;url=select_cus_del.php"/>';
}
else{
echo "<script>alert('login not success');</script>";
echo '<meta http-equiv="refresh" content="0;url=login.php"/>';
}
}?>
<form id="f" name="f" method="post" action="">
<p>username
<label for="t1"></label>
<input type="text" name="t1" id="t1" />
</p>
<p>password
<label for="t2"></label>
<input type="password" name="t2" id="t2" />
</p>
<p>
<input type="submit" name="btn_log" id="btn_log" value="Submit" />
</p>
</form>
</body>