I would agree with Yangshiqi

>>> "yangshiqi" <[EMAIL PROTECTED]> 12/18/04 1:41 PM >>>
And if you have some special intent, you can use ob_start().

 
Best regards,
Yang Shiqi
 
 
 
-----éäåä-----
åää: yangshiqi [mailto:[EMAIL PROTECTED] 
åéé: 2004å12æ18æ 19:36
æää: 'Ahmed Abdel-Aliem'; 'php-general@lists.php.net'
ä: çå: [PHP] header information problem

I don't understand why you want to include header.html before you redirect
the users to the login_success.php?

By the way, you 'd better to add mysql_escape_string() with the username and
password to ensure the security of your code. Coz we can't believe any
users' input from web. May be the sql injection with your site.
Just be careful.

Best regards,
Yang Shiqi

-----éäåä-----
åää: Ahmed Abdel-Aliem [mailto:[EMAIL PROTECTED] 
åéé: 2004å12æ18æ 18:52
æää: php-general@lists.php.net 
ä: [PHP] header information problem

Dear Groups members.

i am making a user protected page, the script works excellent on my
local server, but online it gives me this error :

Warning: Cannot modify header information - headers already sent by
(output started at
/home/me2resh/public_html/apex/upload/header.html:10) in
/home/me2resh/public_html/apex/upload/upload.php on line 33

the script of the page is 

<?
if (!isset($ID)){
        include 'header.html';
        echo "No ID is Set.<br>You Got To This Page By Mistake";
        include 'footer.html';
}else{
        session_start();  
        include 'db.php'; 
        include 'header.html';
        $username = $_POST['username']; 
        $password = $_POST['password']; 
        if((!$username) || (!$password)){ 
                echo "Please enter ALL of the information! <br />"; 
            include 'login_form.html'; 
            include 'footer.html'; 
            exit(); 
        }
        $sql = mysql_query("SELECT * FROM user WHERE User_Login='$username'
AND User_Password='$password'");
        $login_check = mysql_num_rows($sql); 
        if($login_check > 0){
        session_register('ID'); 
    $_SESSION['ID'] = $ID;  
    while($row = mysql_fetch_array($sql)){ 
    foreach( $row AS $key => $val ){ 
        $$key = stripslashes( $val ); 
    } 
        session_register('User_First_Name'); 
        $_SESSION['User_First_Name'] = $User_First_Name; 
        session_register('User_Last_Name'); 
        $_SESSION['User_Last_Name'] = $User_Last_Name;   
        session_register('User_ID'); 
        $_SESSION['User_ID'] = $User_ID;         
        header("Location: login_success.php"); 
    }
        }else{
                include 'header.html';
                echo "You could not be logged in! Either the username and
password
do not match!<br />
                Please try again!<br />"; 
                include 'login_form.html'; 
                include 'footer.html'; 
        }
} 
?>


Can anyone help me with that problem please ?

-- 
Ahmed Abdel-Aliem
www.ApexScript.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 


--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Peninsula University of
Technology or the sender of this e-mail be liable to any party for
any direct, indirect, special or other consequential damages for any
use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to