Need Help Correcting These errors

Reply

Join Date: Apr 2004
Posts: 1
Reputation: DestinyMaker is an unknown quantity at this point 
Solved Threads: 0
DestinyMaker DestinyMaker is offline Offline
Newbie Poster

Need Help Correcting These errors

 
0
  #1
Apr 21st, 2004
Well guys this is the first time iam actually using php... i encountered these errors .. can some one tell me how i can rectify them

Error:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/dynastyr/public_html/rebellion-rpg/header.php:7) in /home/dynastyr/public_html/rebellion-rpg/header.php on line 7

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/dynastyr/public_html/rebellion-rpg/header.php:7) in /home/dynastyr/public_html/rebellion-rpg/header.php on line 7

Here is the Lines from the source code:

<head><title>Rebellion-RPG</title>
<link rel=stylesheet href=style.css>
</head><body leftmargin=0 rightmargin=0 onload="window.status='ExoFusion [v3]'">

<?php include("config.php"); include("game_funcs.php"); session_start(); ?>
<?php
if (!session_is_registered("email") || !session_is_registered("pass")) {
print "Sesion has expired.";
exit;
}
$stat = mysql_fetch_array(mysql_query("select * from players where email='$email' and pass='$pass'"));

if (empty ($stat[id])) {
print "Invalid login.";
exit;
}
$ctime = time();
mysql_query("update players set lpv=$ctime where id=$stat[id]");

$ip = "$HTTP_SERVER_VARS[REMOTE_ADDR]";
mysql_query("update players set ip='$ip' where id=$stat[id]");
mysql_query("update players set page='$title' where id=$stat[id]");
?>

" Well Please guys i need help...!! Please reply asap " thanks.. Sal
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 282
Reputation: Roberdin will become famous soon enough Roberdin will become famous soon enough 
Solved Threads: 6
Team Colleague
Roberdin Roberdin is offline Offline
Supreme Evil Overlord

Re: Need Help Correcting These errors

 
0
  #2
Apr 21st, 2004
Due to a restriction in the HTTP Protocol, YOU HAVE TO SEND COOKIES AND OTHER HEADER DATA BEFORE ANY OUTPUT. The best way I can think of doing that without to many drastic changes would be to move the first php line to the very top. If that chnges the overall output, then put it back and add <?php ob_start(); ?> to the very top, which tells PHP to hold onto output until ob_flush(), ob_end() or the end of the script is encountered, thereby allowing you to define cookies where you want. BTW, ob stands for Output Buffering, in case you were interested.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 29
Reputation: vartotojas is an unknown quantity at this point 
Solved Threads: 0
vartotojas vartotojas is offline Offline
Light Poster

Re: Need Help Correcting These errors

 
0
  #3
May 18th, 2006
Oh god! PLEASE PLEASE could i have that Exofusion release? It seems to be the only one in existance!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC