2

好的,所以我删除了一些 md5 密码加密,因为我遇到了问题。但是现在当我在 phpmyadmin 中调整密码后登录时,标头重定向不起作用。我知道用户已登录,因为当我通过在 url 中键入它转到下一页链接时,它显示用户已登录。

<?php
require('user_chat/config.php');
if(isset($_SESSION[''.CHAT_SESSION_UID.''])){
     header('http://digitalmed1.proadminsolutionsplus.com/wp-content/plugins/bittech_login/main.php');
}

include_once 'include/processes.php';
   $Login_Process = new Login_Process;
      $Login_Process->check_login($_GET['page']);
         $Login = $Login_Process->log_in($_POST['user'], $_POST['pass'], $_POST['remember'], $_POST['page'], $_POST['submit']); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ccrxpersonnel.com</title>
<link type="text/css" rel="Stylesheet" href="http://wordpress.techlifeforgotten.com/wp-content/uploads/ultimatum/b9b341fd54db6ec6136e9edd548c0511.css?ver=3.6.1" />
<body>
<div class="container">

<?php
        if(isset($error_msg)){
        echo '<div class="err">'.$error_msg.' <a href="index.php">Go Back</a></div>';
                } else {
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >

<h1>Log In</h1>

<div class="red"><?php echo $Login; ?></div>
    <div class="label">
        Username:
    </div>
       <input name="user" type="text" class="field" id="user"/> 
       <br />
    <div class="label">
        Password:
    </div>
    <input name="pass" type="password" class="field" id="pass" value="" />
    <br />
    <div class="right">
        <label>Remember Me For 30 Day's
           <input name="remember" type="checkbox" value="true" />
        </label>
    </div>
    <input name="page" type="hidden" value="<? echo $_GET['page']; ?>" />
    <input name="submit" type="submit" class="button" value="Log In" />
    <br />
    <br />
    <div class="center">
        <a href="forgotpassword.php">Password Recovery</a>
    </div>
</form>
<?php
}
?>
<script type="text/javascript" src="js/jquery.js"></script>
<script src="js/jquery.cookie.js"></script>
<script>
$.cookie("c_openbox","", { expires: -30 });
$.cookie("min_openbox","", { expires: -30 });
</script>
<?php
if(isset($_POST['submit']))
{
$time = time();
$username = mysql_real_escape_string($_POST['user']);
$password = mysql_real_escape_string($_POST['pass']);
    if($_POST['user'] != "" && $_POST['pass'] != ""){
        $password = $_POST['pass'];
        $query_test_new_user = mysql_query("SELECT * FROM ".DB_PREFIX."".USER_TABLE." WHERE ".USER_TABLE_USERNAME."='$username' AND ".USER_TABLE_PASSWORD."='$password' LIMIT 1");
        $row_test_new_user = mysql_fetch_array($query_test_new_user);
        $num_test_new_user = mysql_num_rows($query_test_new_user);
        if($num_test_new_user != '0' && $num_test_new_user != ''){
            $_SESSION[''.CHAT_SESSION_UID.''] = $row_test_new_user[''.USER_TABLE_ID.''];
            $_SESSION[''.CHAT_SESSION_UNAME.''] = $row_test_new_user[''.USER_TABLE_USERNAME.''];
            $_SESSION["Select_Whos"] = "Users";
            header('http://digitalmed1.proadminsolutionsplus.com/wp-content/plugins/bittech_login/main.php');
        } else {
        $error_msg = 'Username and/or password is worng. Please try agian.';
        }
    } else {
    $error_msg = 'Username and/or password is empty. Please try agian.';
    }
}
?>
</div>
</body>
</html>

老实说,我不知道发生了什么,但我希望这是我忽略的简单事情。

4

1 回答 1

2

您缺少添加Location标题。还添加exit()在标题之后。

header('Location: http://digitalmed1.proadminsolutionsplus.com/wp-content/plugins/bittech_login/main.php');
exit();
于 2013-11-01T18:02:22.697 回答