I have been given a car registry site that was originally built using frames. I'm integrating the registry into my own site which does not use frames. I didn't code the member registration system and since pulling apart the pages that were in frames, I'm getting the following error on my site when trying to log into the registry:
Warning: Cannot modify header information - headers already sent by
(output started at /home/public_html/specs/registry/memberlogin.php:22)
in /home/public_html/specs/registry/memberlogin.php on line 83
Can anyone explain what could be causing this error?
memberlogin.php:
<?
/* Check User Script */
session_start();
?>
<html>
<head><body>bunch of html code
<?
$email = $_POST['email'];
$password = $_POST['password'];
if((!$email) || (!$password)){
echo "<p style=\"color: #FF0000; font-weight: bold; text-align: center;\">Please enter ALL login information!</div><br />";
include 'welcome.php';
exit();
}
$password = md5($password);
include'dbconnect.php';
$sql = mysql_query("SELECT * FROM car_data WHERE email='$email' AND password='$password'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
// Register some session variables!
session_register('l81email');
$_SESSION['l81email'] = $email;
header("Location: editprofile.php"); <----- ##### THIS IS LINE 83 #####
}
} else {
include 'loginerror.php';
}
?>
</body></html>
editprofile.php:
(This script allows registered members to update their personal and car information. When the data is posted, it is sent to updateprofile.php to update the database, then this script is recalled.)
<?
//check for login
session_start();
if ( empty($l81email) ) {
echo "<center>You MUST <a href=\"welcome.php\">login</a> to proceed!</center>"; }
else {
//user is logged in
include'dbconnect.php';
$query="SELECT * FROM car_data WHERE email='$l81email'";
$result=mysql_query($query);
$rowresult = mysql_fetch_assoc($result);
mysql_close();
include 'rpodecoder.php';
?>
<-- ##### bunch of html code here.... ##### -->
<? } // end of login ELSE
?>