Posted by Rory Walsh on 03/02/05 23:26
The problem there is that I have to test if the user has logged on so I
need to include the if statement? Can the session_start not be called
from within an if statement? Does it really have to be the very first
thing in the script, if so I imagine that this means a single script
cannot be used to manage a complete website?
Chris W. Parker wrote:
> rory walsh <mailto:rorywalsh@ear.ie>
> on Wednesday, March 02, 2005 11:19 AM said:
>
>
>><?php
>>if($_POST["username"]=="rory"){//if user logs in as rory start session
>>session_start();
>>header("Cache-control: private");
>>$_SESSION['loggedin'] = "yes";
>>}
>
>
> Put session_start(); at the *very* beginning of your script. See if that
> helps.
>
>
>
> Chris.
[Back to original message]
|