代码如下:
// *** Start the session
session_start();
// *** Validate request to log in to this site.
$KT_LoginAction = $HTTP_SERVER_VARS["REQUEST_URI"];
if (isset($HTTP_POST_VARS["textfield"])) {
$KT_valUsername = $HTTP_POST_VARS['textfield'];
$KT_fldUserAuthorization = "";
$KT_redirectLoginSuccess = "ok.php";
$KT_redirectLoginFailed = "login.php";
$KT_rsUser_Source = "SELECT user_name, user_pass ";
if ($KT_fldUserAuthorization != "") $KT_rsUser_Source .= "," . $KT_fldUserAuthorization;
$KT_rsUser_Source .= " FROM user WHERE user_name='" . $KT_valUsername . "' AND user_pass='" . $HTTP_POST_VARS['textfield2'] . "'";
$KT_rsUser=$user->Execute($KT_rsUser_Source) or DIE($user->ErrorMsg());
if (!$KT_rsUser->EOF) {
// username and password match - this is a valid user
$KT_Username=$KT_valUsername;
session_unregister("KT_Username");
session_register("KT_Username");
if ($KT_fldUserAuthorization != "") {
$KT_userAuth=$KT_rsUser->Fields($KT_fldUserAuthorization);
} else {
$KT_userAuth="";
}
session_unregister("KT_userAuth");
session_register("KT_userAuth");
if (isset($HTTP_GET_VARS['accessdenied']) && false) {
$KT_redirectLoginSuccess = $HTTP_GET_VARS['accessdenied'];
}
$KT_rsUser->Close();
session_unregister("KT_login_failed");
session_register("KT_login_failed");
$KT_login_failed = false;
// Add code here if you want to do something if login succeded
KT_redir($KT_redirectLoginSuccess);
}
$KT_rsUser->Close();
$KT_login_failed = true;
session_unregister("KT_login_failed");
session_register("KT_login_failed");
// Add code here if you want to do something if login fails
KT_redir($KT_redirectLoginFailed);
}
//PHP ADODB document - made with PHAkt 2.0.60?>
Untitled Document这是采用DWMX生成的代码,传到51空间上运行良好,难道是winxp的问题?