|
|
|
message box แจ้งเตือน เมื่อ login ผิด คือพยายามค้นหาวิธีแล้วแต่ว่าก็ไม่พบตัวที่ต้องการเลยครับ |
|
|
|
|
|
|
|
Code (PHP)
<?
session_start();
mysql_connect("localhost","root","root");
mysql_select_db("mydatabase");
$strSQL = "SELECT * FROM member WHERE Username = '".trim($_POST['txtUsername'])."'
and Password = '".trim($_POST['txtPassword'])."'";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if(!$objResult)
{
echo "<script>alert('Username and Password Incorrect!');</script>";
exit();
}
else
{
$_SESSION["UserID"] = $objResult["UserID"];
$_SESSION["Status"] = $objResult["Status"];
session_write_close();
if($objResult["Status"] == "ADMIN")
{
header("location:admin_page.php");
}
else
{
header("location:user_page.php");
}
}
mysql_close();
?>
Go to : PHP MySQL กับ Login Form ทำระบบ User ล็อกอิน แบบง่าย ๆ ด้วย PHP และ MySQL โดยทำการตรวจสอบ Username และ Password
|
|
|
|
|
Date :
2011-05-10 17:58:53 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากครับ ขอบคุณจิงๆ
|
|
|
|
|
Date :
2011-05-10 20:19:37 |
By :
accio |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากๆ ค่ะ
|
|
|
|
|
Date :
2013-01-17 10:59:16 |
By :
saysuda |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|