 |
ขอตัวอย่าง ENCODE Decode กับ วนลูป table หน่อยคร่า |
|
 |
|
|
 |
 |
|
SELECT username, password, status FROM waumember WHERE username=%s AND password=%s
มันอยู่ตรงไหนครับ
|
 |
 |
 |
 |
Date :
2011-06-17 16:10:04 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['user'])) {
$loginUsername=$_POST['user'];
$password=$_POST['pwd'];
$MM_fldUserAuthorization = "status";
$MM_redirectLoginSuccess = "l2011.php";
$MM_redirectLoginFailed = "f2011.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_Melody, $Melody);
$LoginRS__query=sprintf("SELECT username, password, status FROM waumember WHERE username=%s AND password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $Melody) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'status');
if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
นี้คร่า
|
 |
 |
 |
 |
Date :
2011-06-17 16:28:41 |
By :
Melody |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$LoginRS__query=sprintf("SELECT username, password, status FROM waumember WHERE username=%s AND password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString(md5($password), "text"));
แบบนี้หรือเปล่าที่ต้องการ ถ้าไม่ใช่อธิบายใหม่ละกัน ยังมึนๆ อยู่
|
 |
 |
 |
 |
Date :
2011-06-17 16:31:03 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|