Page 1 of 1
session() question
Posted: Wed Sep 13, 2006 5:36 pm
by akimm
Anyone know what this error might mean?
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /nfs/cust/8/25/05/650528/web/muk.php:3) in /nfs/cust/8/25/05/650528/web/muk.php on line 4
Posted: Wed Sep 13, 2006 5:41 pm
by John Cartwright
search on our forums "headers already sent".. this has been discussed countless times.
ok
Posted: Wed Sep 13, 2006 9:16 pm
by akimm
Will do
Posted: Wed Sep 13, 2006 9:20 pm
by gkwhitworth
yeah....I actually just dealt with this...you should search first, but to save you the trouble.
session_start() is trying to write to the browser but something on line 4 has done it first. Since your code needs this session...it errors. Anyways...if you plan on having a session place the session at the very beginning of your php code and at the beginning of any page you plan on retrieving the session. For example:
The PHP Script:
Code: Select all
<? session_start()
.....php code goes here.....
?>
The HTML Page where you tell them what they have stored:
Code: Select all
<? session_start()
?>
<HTML>
</HEAD>
....and so on
</BODY>
<?
print ("Your name is: $name<br>");
?>
...and so on.....
That should fix at least that error.
--
Greg