if(登录成功){
    echo '<script>alert(\'登录成功\');location.href="'.$PHP_SELF.'";</script>';
    exit;
}

解决方案 »

  1.   

    <?php require_once('../Connections/products.php'); ?>
    <?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";//(登录失败)
      

  2.   

    <script language=Javascript>
        alert("登陆成功!");
        window.history.go(-1);    
        </script>
    登录成功了,马上返回上一个登录页面。如何做?
      

  3.   

    <?
    session_start();
    session_unset();
    session_destroy();
    $tourl=isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:'index.php';
    header("location:$tourl");
    exit;
    ?>
      

  4.   

    像www.mdsm.cn这样的登录!到哪个页面登录之后都返回当前的浏览窗口!
      

  5.   

    翻转图片跟登陆有冲突
    然后
    <?php
    session_start();
    session_unset();
    session_destroy();
    $tourl=isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:'index.php';
    header("location:$tourl");
    exit;
    ?>
      

  6.   

    chf99cn('不到桥头不死心')
    我以前问过了一次。。你只是把我以前的复制了一下而于。