![]() |
session_start Hey All so a few things going on here I can use a hand with 1) I'm getting session error can't send header already sent issue and it's the very first thing being called I attached image for viewing as the 2) issue is looking at image when I add the session_start it messes up all the alignment of the page if I remove it works fine?? PHP Code: |
Re: session_start Make sure the <?php is on line 1 column 1. You may need to look at the ob_start and ob_flush functions. |
Re: session_start and why you think I'm loosing alignment of page? |
Re: session_start dunno OB's don't work I had already tried flush and start both changed nothing? |
Re: session_start I'm thinking the alignment issue is do to the PHP error message being displayed. The session_start() function should not cause an alignment issue. Use a browser with some developer tools like Chrome or Firefox so that you can take a look at the elements individually on the page. Maybe some CSS file isn't loaded because of the PHP error? |
Re: session_start ok, I believe the same as after I wrote that I had another look and yes it's prob cause the text it being output.. anyhow does anyone have another solution I can try to fix this error... |
Re: session_start Can you zip the code file and post it for a look? Is this code included by some other file? Something has output to the browser before session_start() started, it doesn't have to be much a single space is all that is required for session_start() to produce the error. |
Re: session_start Unless I am mistaken you need to close the session at the end of your code... At the moment you are trying to open a session on top of a session thus the error headers already sent. |
Re: session_start Quote:
<?php if (!isset($_SESSION)) { session_start(); } ?> If you want to debug why the session already existed you could add the following to get clues about the session. <?php else { echo '<pre>' . print_r($_SESSION, TRUE) . '</pre>'; } ?> |
Re: session_start Quote:
|
| All times are GMT -6. The time now is 09:08 AM. |