header information problem
| From: | Ahmed Abdel-Aliem | Date: | Sat, 18 Dec 2004 10:52:28 +0000 |
| Subject: | header information problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-204649@lists.php.net to get a copy of this message | ||
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