-1

Possible Duplicate:
Headers already sent by PHP

    if ($_SERVER['REQUEST_METHOD'] == 'POST') 
    {   
include 'verify.php';
$verify = new Verify();
$vali = $verify->VerifyUserLogin($_POST['UserEmail'], $_POST['Password']);
if($_SESSION['umUser'] == true)
{
    header("Location: ../index.php");

}
else
{
    $errorLogin = $_SESSION['loginForm'];
}
    }


                    function VerifyUserLogin($userEmail, $password)
                {
            $this->connect();
            $pass = md5($password);
            $result = mysql_query("SELECT * FROM umuser where umUserIsAdmin = 1 and umUserEmail = '".mysql_real_escape_string($userEmail)."' and umUserPassword = '".mysql_real_escape_string($pass)."'");
            if (mysql_num_rows($result) > 0)
            {
        while($row = mysql_fetch_array($result))
        {
            $_SESSION['umAnanymousGid'] = $row['umUserGID'];
            $_SESSION['umUserName'] = $row['umUserName'];
            $_SESSION['umUserEmail'] = $row['umUserEmail'];
            $_SESSION['umUserId'] = $row['umUserID'];
            $_SESSION['umUser'] = true;
        }


        //echo $_SESSION['umUser'];
        //header('Location:../');

    }

The problem is its not redirecting to location and generting warning Warning: Cannot modify header information - headers already sent by (output started at ....)

Kindly help

Thanks

Community
  • 1
  • 1
Furqan Khyraj
  • 15
  • 1
  • 2
  • 6

1 Answers1

0

you can do:

<?php
ob_start();
/**
content of your page
*/
ob_end_flush();
?>

or you can test the lenghth (count) of $_SESSION, if it's null so any session is open

chokrijobs
  • 761
  • 1
  • 6
  • 10