How to control session_start
Posted: Fri May 21, 2010 5:05 am
I have a site I am developing but I keep encountering the same issue.
The system uses a mySQL database structure to store user details and therefore I have created a PHP page that evaluates the login process.
This evaluation section is at the top of the index.php page as a require_once call. The actual webpage then loads, including the login box. Currently I simply want the system to evaluate as correct the log in and then return to the index.php page.
So, the code is working. I type in the username and password, click submit and it then reloads the index.php page. But I then get the error message:
Warning: Cannot modify header information - headers already sent by...
I know this is down to the reusing of session_start but how do I get the system to evaluate that the session_start has already been called and so not to do it again; avoiding the error altogether?
The system uses a mySQL database structure to store user details and therefore I have created a PHP page that evaluates the login process.
This evaluation section is at the top of the index.php page as a require_once call. The actual webpage then loads, including the login box. Currently I simply want the system to evaluate as correct the log in and then return to the index.php page.
So, the code is working. I type in the username and password, click submit and it then reloads the index.php page. But I then get the error message:
Warning: Cannot modify header information - headers already sent by...
I know this is down to the reusing of session_start but how do I get the system to evaluate that the session_start has already been called and so not to do it again; avoiding the error altogether?