複製程式碼 程式碼如下:
$hostname_conn = "localhost";
$testbased ";
$username_conn = "root";
$password_conn = "1981427";
$conn = mysql_connect($hostname_conn, $username_conn, $password_conn); ? >
程式碼如下://此函數用於將一般字串轉換成SQL語句所需的格式
function GetSQLValueString($theValue, $theType)
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
$theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
}
return $theValue;
}
?>
程式碼如下:
程式碼如下:
; ();
//如果Session不存在,則跳到Admin.php
if (!(isset($_SESSION['MM_Username']))) {
header("Location: admin. php");
exit;
}
?>
複製程式碼 程式碼如下:
// *** Validate request to login to this site.
session_start() ;
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck)
Psession_register('PrevUrl'] = $accesscheck)
Psession_register('PrevUrl'); ;
}
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "adminmain.php";
$MM_redirectLoginFailed = "admin.php";
$MM_redirecttoReferer = firectto); conn);
$LoginRS__query=sprintf("SELECT adminname, password FROM admin WHERE adminname='%s' AND password='%s'",
get_magic_quotes_gpc() ? loginUsernamees : Userslashname,$log 。 >if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_Username'] = $loginUsername;
$GLALS' '] = $loginStrGroup;
//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");
if (isset($_SESSION['PrevUrl'); && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
. "Location: ". $MM_redirectLoginFailed );
}
}
?>
留言板- 管理登陸