登录页面问题 if(登录成功){ echo '<script>alert(\'登录成功\');location.href="'.$PHP_SELF.'";</script>'; exit;} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php require_once('../Connections/products.php'); ?><?phpsession_start();$colname_Recdl = "1";if (isset($_SESSION['MM_Username'])) { $colname_Recdl = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);}mysql_select_db($database_products, $products);$query_Recdl = sprintf("SELECT * FROM memberdata WHERE m_username = '%s'", $colname_Recdl);$Recdl = mysql_query($query_Recdl, $products) or die(mysql_error());$row_Recdl = mysql_fetch_assoc($Recdl);$totalRows_Recdl = mysql_num_rows($Recdl);$MM_paramName = ""; // *** Start the sessionsession_start();// *** Validate request to log in to this site.$FF_LoginAction = $HTTP_SERVER_VARS['PHP_SELF'];if (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING']!="") $FF_LoginAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING'];if (isset($HTTP_POST_VARS['m_username'])) { $FF_valUsername=$HTTP_POST_VARS['m_username']; $FF_valPassword=$HTTP_POST_VARS['m_passwd']; $FF_fldUserAuthorization=""; $FF_redirectLoginSuccess="dlin.php"; $FF_redirectLoginFailed="dlok.php"; $FF_rsUser_Source="SELECT m_username, m_passwd "; if ($FF_fldUserAuthorization != "") $FF_rsUser_Source .= "," . $FF_fldUserAuthorization; $FF_rsUser_Source .= " FROM memberdata WHERE m_username='" . $FF_valUsername . "' AND m_passwd='" . $FF_valPassword . "'"; mysql_select_db($database_products, $products); $FF_rsUser=mysql_query($FF_rsUser_Source, $products) or die(mysql_error()); $row_FF_rsUser = mysql_fetch_assoc($FF_rsUser); if(mysql_num_rows($FF_rsUser) > 0) { // username and password match - this is a valid user $MM_Username=$FF_valUsername; session_register("MM_Username"); if ($FF_fldUserAuthorization != "") { $MM_UserAuthorization=$row_FF_rsUser[$FF_fldUserAuthorization]; } else { $MM_UserAuthorization=""; } session_register("MM_UserAuthorization"); if (isset($accessdenied) && false) { $FF_redirectLoginSuccess = $accessdenied; } mysql_free_result($FF_rsUser); session_register("FF_login_failed"); $FF_login_failed = false; header ("Location: $FF_redirectLoginSuccess"); exit; } mysql_free_result($FF_rsUser); session_register("FF_login_failed"); $FF_login_failed = true; header ("Location: $FF_redirectLoginFailed"); exit;}// *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters// create the list of parameters which should not be maintained$MM_removeList = "&index=";if ($MM_paramName != "") $MM_removeList .= "&".strtolower($MM_paramName)."=";$MM_keepURL="";$MM_keepForm="";$MM_keepBoth="";$MM_keepNone="";// add the URL parameters to the MM_keepURL stringreset ($HTTP_GET_VARS);while (list ($key, $val) = each ($HTTP_GET_VARS)) { $nextItem = "&".strtolower($key)."="; if (!stristr($MM_removeList, $nextItem)) { $MM_keepURL .= "&".$key."=".urlencode($val); }}// add the URL parameters to the MM_keepURL stringif(isset($HTTP_POST_VARS)){ reset ($HTTP_POST_VARS); while (list ($key, $val) = each ($HTTP_POST_VARS)) { $nextItem = "&".strtolower($key)."="; if (!stristr($MM_removeList, $nextItem)) { $MM_keepForm .= "&".$key."=".urlencode($val); } }}// create the Form + URL string and remove the intial '&' from each of the strings$MM_keepBoth = $MM_keepURL."&".$MM_keepForm;if (strlen($MM_keepBoth) > 0) $MM_keepBoth = substr($MM_keepBoth, 1);if (strlen($MM_keepURL) > 0) $MM_keepURL = substr($MM_keepURL, 1);if (strlen($MM_keepForm) > 0) $MM_keepForm = substr($MM_keepForm, 1);?>这是代码。。 $FF_redirectLoginSuccess="dlin.php";//(登录成功) $FF_redirectLoginFailed="dlok.php";//(登录失败) <script language=Javascript> alert("登陆成功!"); window.history.go(-1); </script>登录成功了,马上返回上一个登录页面。如何做? <?session_start();session_unset();session_destroy();$tourl=isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:'index.php';header("location:$tourl");exit;?> 像www.mdsm.cn这样的登录!到哪个页面登录之后都返回当前的浏览窗口! 翻转图片跟登陆有冲突然后<?phpsession_start();session_unset();session_destroy();$tourl=isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:'index.php';header("location:$tourl");exit;?> chf99cn('不到桥头不死心')我以前问过了一次。。你只是把我以前的复制了一下而于。 关于cookie取值的问题 关于PHP的小白问题 页面回传数据的问题 php中如何删除图片..用js能否删除... PHP 输出插入数据库的结果问题 PHP radio box 急求,关于mysql的问题哦! 关于php连mysql的两个问题 传汉字进MYSQL的问题,没分了 怎样用php实现文件新闻的检索 请问如何向一个页面POST一条字符串,并获取返回值? 有用PHPEdit的吗?帮我一下啦
<?php
session_start();
$colname_Recdl = "1";
if (isset($_SESSION['MM_Username'])) {
$colname_Recdl = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}
mysql_select_db($database_products, $products);
$query_Recdl = sprintf("SELECT * FROM memberdata WHERE m_username = '%s'", $colname_Recdl);
$Recdl = mysql_query($query_Recdl, $products) or die(mysql_error());
$row_Recdl = mysql_fetch_assoc($Recdl);
$totalRows_Recdl = mysql_num_rows($Recdl);$MM_paramName = ""; // *** Start the session
session_start();
// *** Validate request to log in to this site.
$FF_LoginAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING']!="") $FF_LoginAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING'];
if (isset($HTTP_POST_VARS['m_username'])) {
$FF_valUsername=$HTTP_POST_VARS['m_username'];
$FF_valPassword=$HTTP_POST_VARS['m_passwd'];
$FF_fldUserAuthorization="";
$FF_redirectLoginSuccess="dlin.php";
$FF_redirectLoginFailed="dlok.php";
$FF_rsUser_Source="SELECT m_username, m_passwd ";
if ($FF_fldUserAuthorization != "") $FF_rsUser_Source .= "," . $FF_fldUserAuthorization;
$FF_rsUser_Source .= " FROM memberdata WHERE m_username='" . $FF_valUsername . "' AND m_passwd='" . $FF_valPassword . "'";
mysql_select_db($database_products, $products);
$FF_rsUser=mysql_query($FF_rsUser_Source, $products) or die(mysql_error());
$row_FF_rsUser = mysql_fetch_assoc($FF_rsUser);
if(mysql_num_rows($FF_rsUser) > 0) {
// username and password match - this is a valid user
$MM_Username=$FF_valUsername;
session_register("MM_Username");
if ($FF_fldUserAuthorization != "") {
$MM_UserAuthorization=$row_FF_rsUser[$FF_fldUserAuthorization];
} else {
$MM_UserAuthorization="";
}
session_register("MM_UserAuthorization");
if (isset($accessdenied) && false) {
$FF_redirectLoginSuccess = $accessdenied;
}
mysql_free_result($FF_rsUser);
session_register("FF_login_failed");
$FF_login_failed = false;
header ("Location: $FF_redirectLoginSuccess");
exit;
}
mysql_free_result($FF_rsUser);
session_register("FF_login_failed");
$FF_login_failed = true;
header ("Location: $FF_redirectLoginFailed");
exit;
}// *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
// create the list of parameters which should not be maintained
$MM_removeList = "&index=";
if ($MM_paramName != "") $MM_removeList .= "&".strtolower($MM_paramName)."=";
$MM_keepURL="";
$MM_keepForm="";
$MM_keepBoth="";
$MM_keepNone="";
// add the URL parameters to the MM_keepURL string
reset ($HTTP_GET_VARS);
while (list ($key, $val) = each ($HTTP_GET_VARS)) {
$nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepURL .= "&".$key."=".urlencode($val);
}
}
// add the URL parameters to the MM_keepURL string
if(isset($HTTP_POST_VARS)){
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepForm .= "&".$key."=".urlencode($val);
}
}
}
// create the Form + URL string and remove the intial '&' from each of the strings
$MM_keepBoth = $MM_keepURL."&".$MM_keepForm;
if (strlen($MM_keepBoth) > 0) $MM_keepBoth = substr($MM_keepBoth, 1);
if (strlen($MM_keepURL) > 0) $MM_keepURL = substr($MM_keepURL, 1);
if (strlen($MM_keepForm) > 0) $MM_keepForm = substr($MM_keepForm, 1);?>这是代码。。 $FF_redirectLoginSuccess="dlin.php";//(登录成功)
$FF_redirectLoginFailed="dlok.php";//(登录失败)
alert("登陆成功!");
window.history.go(-1);
</script>
登录成功了,马上返回上一个登录页面。如何做?
session_start();
session_unset();
session_destroy();
$tourl=isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:'index.php';
header("location:$tourl");
exit;
?>
然后
<?php
session_start();
session_unset();
session_destroy();
$tourl=isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:'index.php';
header("location:$tourl");
exit;
?>
我以前问过了一次。。你只是把我以前的复制了一下而于。