嘿傢伙我試圖用默認的Dreamweaver登錄模塊登錄時出現此錯誤,請幫助我 - 這是一個雖然一個,我只是一個HTML設計師嘗試爲我正在工作的一個小網站製作一個簡單的登錄腳本。它是偉大的,如果你能幫助致命錯誤:調用未定義的函數getsqlvaluestring()
<?php require_once('../Connections/dsfsdfsdfd.php'); ?>
<?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['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "access_level";
$MM_redirectLoginSuccess = "index.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_promocenter, $promocenter);
$LoginRS__query=sprintf("SELECT username, password, destination_page FROM
users WHERE username=%s AND password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "int"));
$LoginRS = mysql_query($LoginRS__query, $promocenter) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'access_level');
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']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess);
}
else {
header("Location: ". $MM_redirectLoginFailed);
}
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType,
$theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_promocenter, $promocenter);
$query_rs_users_login = "SELECT * FROM users";
$rs_users_login = mysql_query($query_rs_users_login, $promocenter)
or die(mysql_error());
$row_rs_users_login = mysql_fetch_assoc($rs_users_login);
$totalRows_rs_users_login = mysql_num_rows($rs_users_login);
?>
對不起球員,錯誤是致命的錯誤:調用在/ U1 /家庭/ XXXXXX /的public_html /通訊/資源/ promocenter /管理/登入未定義功能getsqlvaluestring()。第22行的php這是標準的Dreamweaver CS5代碼。
連接到數據庫等。我確定我的代碼中包含了該文件,請在那裏查看。我也可以說,這段代碼在一年中工作得很好,突然之間,我每次嘗試登錄時都會出現這個錯誤。正常的前端仍然顯示來自數據庫的字段。這只是/管理員/登錄方面給出的問題
如果您可以發佈**完整**錯誤消息,這將有所幫助。它會告訴人們在哪一行發生錯誤。在一個無關的說明中,術語*「Dreamweaver登錄模塊」*讓我不寒而慄:) – rdlowrey
你可以通過並縮進你的代碼嗎?它會讓每個人都變得更加可讀。 – jprofitt
更好,如果你告訴哪一行你得到的錯誤...像'不工作如果(PHP_VERSION> = 5.1){session_regenerate_id(true);} –