943,891 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 3127
  • PHP RSS
Apr 21st, 2004
0

Need Help Correcting These errors

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
DestinyMaker is offline Offline
1 posts
since Apr 2004
Apr 21st, 2004
0

Re: Need Help Correcting These errors

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.
Team Colleague
Reputation Points: 63
Solved Threads: 6
Supreme Evil Overlord
Roberdin is offline Offline
282 posts
since Feb 2003
May 18th, 2006
0

Re: Need Help Correcting These errors

Oh god! PLEASE PLEASE could i have that Exofusion release? It seems to be the only one in existance!
Reputation Points: 10
Solved Threads: 0
Light Poster
vartotojas is offline Offline
29 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: can some 1 teach me some php?
Next Thread in PHP Forum Timeline: PHP and MySql





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC