[Help] Lỗi đăng nhập 2 lần help me

Mình có code đăng nhập ,ko biết fix sao khi đăng nhập enter lần đầu thì nó hiện ra trang bào quá trình đăng nhập song nó quay về trang đăng nhập lại ,enter lần 2 nó mới vào trang thông tin báo dn thành công ,chả biết nó bị gì luôn
code trang đăng nhập
Mã:
<?php
if (file_exists("laivt_firewall.php")) 
include_once "laivt_firewall.php";
if (strtoupper($_SERVER['REQUEST_METHOD'])!= "POST") {
echo'<META http-equiv="refresh" content="0; url=../../SignIn/">';
}
else 
{
session_start();
	$no=$_SESSION['number'];
	if($_POST['ctl00$PSPContent$wzdSignUp$txtVerify']!=$no)
	{
	//session_destroy();
	Session_destroy();//huy session
	require_once('../header.php');
		echo "
	<div class=\"bg_top_right\">
                </div>
            </div>
            <div id=\"all_col\">
	<table id=\"ctl00_ContentPlaceHolder1_Step1\" style=\"width: 100%; border-collapse: collapse;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
	<tr style=\"height: 100%;\">
		<td>
	<tr class=\"bodyBottom\" height=\"100%\">
		<td colspan=\"2\" width=\"100%\" valign=\"top\"> 
    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100%\">
        <tbody><tr class=\"bodyBottom\">
            <td width=\"80\"></td>
            <td align=\"left\" valign=\"top\">
                <table id=\"ctl00_PSPContent_wzdSignUp\" style=\"width: 100%; border-collapse: collapse;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
	<tbody><tr style=\"height: 100%;\">
		<td>
 
									<!--BEGIN Notice-->
                                     <div class=\"reg_all\">
                        <div class=\"reg_top\">
                        </div>
                        <div class=\"reg_center\">
                            <div class=\"step_reg_bar\">
                                <img src=\"../Images/dangnhap.gif\" alt=\"\" border=\"0\" />
                            </div>
                            <div class=\"reg_title\">Thông báo trong quá trình đăng kí</div>
                                     <table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"95%\">
                                        <tbody><tr><td colspan=\"2\" height=\"10\"></td></tr>
                                        
                                        <tr>
                                            <td align=\"left\" width=\"100%\" nowrap=\"nowrap\"> 
											
											<br>
											
		<br>
		
		<br>
		</center>
		"; 
		
	}
	else
	{
?>
<?


	
	
	$account = $_POST['ctl00$PSPContent$wzdSignUp$txtEmail'];
	$pasword = $_POST['ctl00$PSPContent$wzdSignUp$txtPassword'];
	
	//chuyen pass sang dang md5
	$pass_md5 = md5($pasword);
	
	//lien ket file ket noi voi oracle
	//require_once('../include/global.php');
	//
	//$tlbb = new DB($db_user, $db_pwd, $db);
	//$conn = oci_pconnect($db_user, $db_pwd, $db);
	 require_once('../include/global_mysql_win.php');
	  $tlbb_table_win = new DB($db_host1, $db_user1, $db_pwd1, $tlbb_table_win, $pconnect1);
	// Kiem tra tai khoan
	 $query = " 
    SELECT *
    FROM web.account 
    WHERE name = '$account' AND password='$pass_md5'
    ";  
    $check = $tlbb_table_win->query($query);
    $count = $tlbb_table_win->num_rows($check);
	$data = $tlbb_table_win->get_one($query); 
    //tai khoan khong ton tai
    if ($count == 0) {
        EndOfPage('<font size=\"2\">Bạn Hãy Kiễm Tra Lại Tài Khoản và Pass</font><br><br>');
    }
    //kiem tra pass
         if ( $pass_md5 !=$data['password'] ) { 
        EndOfPage('<font size=\"2\">Mật Khẫu Ko chính xác</font><br><br>');
    }  
        $_SESSION['account'] = $account; 
        $_SESSION['pasword'] = $pasword; 
        $_SESSION['email'] = $email;  
	
//neu ok thi thuc hien


	
	//thong bao  thanh cong
  header("location: ../../Account/Profile/");  
		
	
	}//kiem tra pass ok
    //kiem tra tai khoan ok
	//nhap ma xac nhan ok


//session_destroy();
}//ket noi may chu


function EndOfPage($ErrMsg)
{
	require_once('../header.php');
echo'<div class="bg_top_right">
                </div>
            </div>
            <div id="all_col">
	<table id="ctl00_ContentPlaceHolder1_Step1" style="width: 100%; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0">
	<tr style="height: 100%;">
		<td>
	<tr class="bodyBottom" height="100%">
		<td colspan="2" width="100%" valign="top">
                <table id="ctl00_PSPContent_wzdSignUp" style="width: 100%; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0">
	<tbody><tr style="height: 100%;">
		<td>


									<!--BEGIN Notice-->
                                     <div class="reg_all">
                        <div class="reg_all">
                        <div class="reg_top">
                        </div>
                        <div class="reg_center">
                            <div class="step_reg_bar">
                                <img src="../Images/dangnhap.gif" alt="" border="0" />
                            </div>
                            <div class="reg_title"></div>
                                     <table border="0" cellpadding="1" cellspacing="1" width="95%">
                                        <tbody><tr><td colspan="2" height="10"></td></tr>
                                        
                                        <tr>
                                            <td align="left" width="100%" nowrap="nowrap"> ';
	ErrorLogin($ErrMsg);
echo "</table>
	</tr><tr>
	</tr>
</tbody></table> 
                              <div class=\"reg_bt\"></div>
";


require_once('../footer.php');


	die(0);
}


?>
 

DMGM

Bạn có thể mô tả rõ hơn được không. Chỉ có code 1 trang đó thì mình không thể giúp bạn được.
 
360gamethu.com/SignIn/
tktest : tichuot0777 pass : 123456
DMGM ,đăng nhập thư đi , đăng nhập lần đâu ko được ,lần 2 mới được

nó có 2 file file Login.php hiện khung đăng nhập ,điền tk + pass ,,khi bấm đăng nhập thì nó chuyển qua file login_ok.php
PHP:
<?phpif (file_exists("laivt_firewall.php")) include_once "laivt_firewall.php";@Session_start();    if (!isset($_SESSION['account'])) {	//chua dang nhaprequire_once('../header.php');?><style type="text/css">body,td,th {	color: #FFF;}a:link {	color: #E89F9D;}</style>

<form name="aspnetForm" method="post" action="Success.aspx" onSubmit="return checkdata();" id="login_form">
<script type="text/javascript">function checkdata(){	var obj = document.aspnetForm;	if (obj.ctl00$PSPContent$wzdSignUp$txtEmail.value.length < 6 || obj.ctl00$PSPContent$wzdSignUp$txtEmail.value.length > 50) {		alert("Tài khoản không hợp lệ.");		obj.ctl00$PSPContent$wzdSignUp$txtEmail.focus();		return false;	}		if (obj.ctl00$PSPContent$wzdSignUp$txtPassword.value.length == 0) {		alert("Bạn chưa nhập mật khẩu.");		obj.ctl00$PSPContent$wzdSignUp$txtPassword.focus();		return false;	}		if (obj.ctl00$PSPContent$wzdSignUp$txtPassword.value.length < 6 || obj.ctl00$PSPContent$wzdSignUp$txtPassword.value.length > 50) {		alert("Mật khẩu phải có ít nhất 6 ký tự.");		obj.ctl00$PSPContent$wzdSignUp$txtPassword.focus();		return false;	}
		if (obj.ctl00$PSPContent$wzdSignUp$txtVerify.value.length == 0) {		alert("Bạn chưa nhập mã xác nhận.");		obj.ctl00$PSPContent$wzdSignUp$txtVerify.focus();		return false;	}		return true;}</script>
	<div class="bg_top_right">                </div>            </div>            <div id="all_col">	<table id="ctl00_ContentPlaceHolder1_Step1" style="width: 100%; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0">	<tr style="height: 100%;">		<td>	<tr class="bodyBottom" height="100%">		<td colspan="2" width="100%" valign="top">                <table id="ctl00_PSPContent_wzdSignUp" style="width: 100%; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0">	<tbody><tr style="height: 100%;">		<td bgcolor="#FFFFFF">									<!--BEGIN Notice-->            <div id="all_col">
                <div id="left_login_col">                    <div class="left_login_col">                        <h2>                           <strong style="color:white ;"> Thiên Long Đinh Mệnh</strong>                        </h2>                                                                             <strong <a href="../../Account/SignUp/"><img src="/images/taigame-nor.gif" width="470px" height="200px" align="right";/></a></strong>							
							

                    </div>                </div>                <div id="right_login_col">
                    <div class="right_login_top">                        <h2>                            <center><strong style="color: red;">ĐĂNG NHẬP HỆ THỐNG</strong></center>                        </h2>                    </div>                    <div class="right_login_ct"><table width="100%" border="0" cellspacing="0" cellpadding="0">                            <tr>                                <td width="29%">
                                </td>                                <td width="71%">                                    <input type="hidden" name="ctl00$PSPContent$PSPLoginView$hUrlReferer" id="ctl00_PSPContent_PSPLoginView_hUrlReferer" value="../../Business/GateCard/" />                                                                        <span id="ctl00_PSPContent_PSPLoginView_lbError" class="errorText"></span>                                </td>                            </tr>                            <tr>                                <td width="29%">                                </td>
                                <td width="71%">                                    <span id="ctl00_PSPContent_PSPLoginView_lbErrorUserName" class="errorText"></span>                                    <span id="ctl00_PSPContent_PSPLoginView_RequiredFieldValidator3" style="color:Red;display:none;">Bạn chưa nhập tên tài khoản.</span>                                    <span id="ctl00_PSPContent_PSPLoginView_RegularExpressionValidator8" style="color:Red;display:none;">Tên tài khoản phải có từ 3 đến 50 ký tự</span>                                </td>                            </tr>                            <tr>                                <td width="40%" height="40"><span style="font-size: 13px; color:red;">        Tên truy cập:                                </td>                                <td width="71%"><input style="cursor: default;" name="ctl00$PSPContent$wzdSignUp$txtEmail" maxlength="50" id="ctl00_PSPContent_wzdSignUp_txtEmail" autocomplete="off" type="text">                                                                               </td>                            </tr>                            <tr>                                <td width="29%">                                </td>
                                <td width="71%">                                    <span id="ctl00_PSPContent_PSPLoginView_lbErrorPassword" class="errorText"></span>                                    <span id="ctl00_PSPContent_PSPLoginView_RequiredFieldValidator2" style="color:Red;display:none;">Bạn chưa nhập mật khẩu</span>                                    <span id="ctl00_PSPContent_PSPLoginView_RegularExpressionValidator3" style="color:Red;display:none;">Mật khẩu phải có ít nhất 6 ký tự</span>                                </td>                            </tr>                            <tr>                                <td width="29%" height="25"><span style="font-size: 13px;color:red;">                                    Mật khẩu:                                </td>                                <td width="71%">                                    <input name="ctl00$PSPContent$wzdSignUp$txtPassword" maxlength="64" id="ctl00_PSPContent_wzdSignUp_txtPassword" onkeyup="testPassword(this.value)" type="password">                                </td>                            </tr>                                                        <tr>                                <td height="25">                                     
                                </td>                                <td>                                    <table width="100%" border="0" cellspacing="3" cellpadding="2">                                        <tr>                                            <td width="174" colspan="3">                                               <span style="font-size: 12px;"> <a href="../../Account/ForgetPass/">Quên mật khẩu ?</a>                                            </td>                                        </tr>                                    </table>                                </td>                            </tr>
                            <tr>                                <td>                                                                     </td>                  <td height="30"><div align="left">                    <input type="submit" name="ctl00$PSPContent$PSPLoginView$btLogin" value="" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$PSPContent$PSPLoginView$btLogin", "", true, "Login", "", false, false))" id="ctl00_PSPContent_PSPLoginView_btLogin" style="border-width:0px;height:40px;width:140px;align=left;background: url('../images/dn.png');                                        cursor: pointer" />                  </div></td></tr>                        </table>
                    </div>                    <div class="right_login_ct1">                    </div>                    <div class="right_login_ct" style="line-height: 22px; color: #2f2f2f"><div align="center"><span style="font-size: 12px; display: block; text-align: center;">Bạn chưa có tài khoản ?</span><strong style="color:#c8c8c7 ;">yyyyyy</strong><a href="../../Account/SignUp/"><img src="../images/dk.png" width="140px" height="40px" align="middle"/></a><br />  <span style="font-size: 16px; display: block; text-align: center; padding-top: 3px;padding-bottom: 3px;"><strong></div><div></div>                  </div>                    <div class="right_login_bt">                    </div>                </div>            </div>
                            <!-- END CONTENT -->														<?phprequire_once('../footer.php');}
else //da dang nhap{echo'<meta http-equiv="refresh" content="0;URL=../../Account/Profile/">';}?>
file login_ok xử lý kiểm tra thông tin đúng không
Mã:
<?php
if (file_exists("laivt_firewall.php")) 
include_once "laivt_firewall.php";
if (strtoupper($_SERVER['REQUEST_METHOD'])!= "POST") {
echo'<META http-equiv="refresh" content="0; url=../../SignIn/">';
}
else 
{
session_start();
    $no=$_SESSION['number'];
    if($_POST['ctl00$PSPContent$wzdSignUp$txtVerify']!=$no)
    {
    //session_destroy();
    Session_destroy();//huy session
    require_once('../header.php');
        echo "
    <div class=\"bg_top_right\">
                </div>
            </div>
            <div id=\"all_col\">
    <table id=\"ctl00_ContentPlaceHolder1_Step1\" style=\"width: 100%; border-collapse: collapse;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
    <tr style=\"height: 100%;\">
        <td>
    <tr class=\"bodyBottom\" height=\"100%\">
        <td colspan=\"2\" width=\"100%\" valign=\"top\"> 
    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100%\">
        <tbody><tr class=\"bodyBottom\">
            <td width=\"80\"></td>
            <td align=\"left\" valign=\"top\">
                <table id=\"ctl00_PSPContent_wzdSignUp\" style=\"width: 100%; border-collapse: collapse;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
    <tbody><tr style=\"height: 100%;\">
        <td>
 
                                    <!--BEGIN Notice-->
                                     <div class=\"reg_all\">
                        <div class=\"reg_top\">
                        </div>
                        <div class=\"reg_center\">
                            <div class=\"step_reg_bar\">
                                <img src=\"../Images/dangnhap.gif\" alt=\"\" border=\"0\" />
                            </div>
                            <div class=\"reg_title\">Thông báo trong quá trình đăng kí</div>
                                     <table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"95%\">
                                        <tbody><tr><td colspan=\"2\" height=\"10\"></td></tr>
                                        
                                        <tr>
                                            <td align=\"left\" width=\"100%\" nowrap=\"nowrap\"> 
                                            
                                            <br>
                                            
        <br>
        
        <br>
        </center>
        "; 
        
    }
    else
    {
?>
<?


    
    
    $account = $_POST['ctl00$PSPContent$wzdSignUp$txtEmail'];
    $pasword = $_POST['ctl00$PSPContent$wzdSignUp$txtPassword'];
    
    //chuyen pass sang dang md5
    $pass_md5 = md5($pasword);
    
    //lien ket file ket noi voi oracle
    //require_once('../include/global.php');
    //
    //$tlbb = new DB($db_user, $db_pwd, $db);
    //$conn = oci_pconnect($db_user, $db_pwd, $db);
     require_once('../include/global_mysql_win.php');
      $tlbb_table_win = new DB($db_host1, $db_user1, $db_pwd1, $tlbb_table_win, $pconnect1);
    // Kiem tra tai khoan
     $query = " 
    SELECT *
    FROM web.account 
    WHERE name = '$account' AND password='$pass_md5'
    ";  
    $check = $tlbb_table_win->query($query);
    $count = $tlbb_table_win->num_rows($check);
    $data = $tlbb_table_win->get_one($query); 
    //tai khoan khong ton tai
    if ($count == 0) {
        EndOfPage('<font size=\"2\">Bạn Hãy Kiễm Tra Lại Tài Khoản và Pass</font><br><br>');
    }
    //kiem tra pass
         if ( $pass_md5 !=$data['password'] ) { 
        EndOfPage('<font size=\"2\">Mật Khẫu Ko chính xác</font><br><br>');
    }  
        $_SESSION['account'] = $account; 
        $_SESSION['pasword'] = $pasword; 
        $_SESSION['email'] = $email;  
    
//neu ok thi thuc hien


    
    //thong bao  thanh cong
  header("location: ../../Account/Profile/");  
        
    
    }//kiem tra pass ok
    //kiem tra tai khoan ok
    //nhap ma xac nhan ok


//session_destroy();
}//ket noi may chu


function EndOfPage($ErrMsg)
{
    require_once('../header.php');
echo'<div class="bg_top_right">
                </div>
            </div>
            <div id="all_col">
    <table id="ctl00_ContentPlaceHolder1_Step1" style="width: 100%; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0">
    <tr style="height: 100%;">
        <td>
    <tr class="bodyBottom" height="100%">
        <td colspan="2" width="100%" valign="top">
                <table id="ctl00_PSPContent_wzdSignUp" style="width: 100%; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0">
    <tbody><tr style="height: 100%;">
        <td>


                                    <!--BEGIN Notice-->
                                     <div class="reg_all">
                        <div class="reg_all">
                        <div class="reg_top">
                        </div>
                        <div class="reg_center">
                            <div class="step_reg_bar">
                                <img src="../Images/dangnhap.gif" alt="" border="0" />
                            </div>
                            <div class="reg_title"></div>
                                     <table border="0" cellpadding="1" cellspacing="1" width="95%">
                                        <tbody><tr><td colspan="2" height="10"></td></tr>
                                        
                                        <tr>
                                            <td align="left" width="100%" nowrap="nowrap"> ';
    ErrorLogin($ErrMsg);
echo "</table>
    </tr><tr>
    </tr>
</tbody></table> 
                              <div class=\"reg_bt\"></div>
";


require_once('../footer.php');


    die(0);
}


?>
 

DMGM

mình đăng nhập ok mà bạn? đăng nhập xong là vào trang 360gamethu.com/Account/Profile/ luôn
 
DMGM xóa lịch sử đi ,bấm về trang chủ 360gamethu.com rồi bấm đăng ký rồi đăng nhập thử xem ,sao mình toàn bị
 

DMGM

ở trong file login_ok.php bạn kiểm tra dòng
Mã:
$no=$_SESSION['number'];
mình không thấy đoạn code bạn tạo giá trị cho $_SESSION['number'] và không thấy $_POST['ctl00$PSPContent$wzdSignUp$txtVerify'] ở trong form
 

DMGM

bạn thử chuyển đoạn code này
Mã:
if($_POST['ctl00$PSPContent$wzdSignUp$txtVerify']!=$no)
thành
Mã:
if(0)
để bỏ qua bước kiểm tra capcha.
Chúc bạn may mắn
 

Thống kê

Chủ đề
102,787
Bài viết
470,611
Thành viên
340,593
Thành viên mới nhất
winspire
Top