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);

}

?>