Xữ lý đăng nhập có session

<?php session_start(); ?>
<?php
include("connection.php");
$us = $_POST['us'];
$pa = md5($_POST['pa']);

$sq="select * from customer where username='$us' and password='$pa'";
$result = mysql_query($sq);
if(mysql_num_rows($result)>0)
{
$_SESSION['user']=$us;
echo "<script>alert('Login is successful!')</script>";
echo '<meta http-equiv="REFRESH" content ="0;URL=doimatkhau.php"/>';
}
else
{
echo "<script>alert('Login is not successful!')</script>";
echo '<meta http-equiv="REFRESH" content ="0;URL=formdn_ss.php"/>';
}

?>

Comments

Bài đăn phổ biến

Tính Bình Phương 1 Số Trong Python

Deploy website lên VPS hoặc Hosting với Gitlab CI/CD

Đổi tên "READ MORE" trong bài post

MỞ CAMERA VÀ CHỤP ẢNH BẰNG PHP