|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
php/mysql header and session_start errors
My code all makes perfect sense to to and all the testing for my auth_level is correct and works properly.
My problem when testing the code is that it comes out with error with my session_start(); line and my header("Location: auth2menu.php"); line. Can Anyone help or tell me what these errors are trying to communicate? Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/oddprod/public_html/login3.php:9) in /home/oddprod/public_html/login3.php on line 11 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/oddprod/public_html/login3.php:9) in /home/oddprod/public_html/login3.php on line 11 Warning: Cannot modify header information - headers already sent by (output started at /home/oddprod/public_html/login3.php:9) in /home/oddprod/public_html/login3.php on line 47 PHP Code:
|
|
#2
|
||||
|
||||
|
Usually, you'd expect to see this if there was extra space at the top of your file or if this file is included in something that sends some output. Is either of these the case?
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#3
|
||||
|
||||
|
Can you share with us what's on line 9? You call the session at line 11, and there is some output generated on line 9. You can try to put the session_start() on top of your code, just as in your snippet.
Cheers,
__________________
Work to live, don't live to work |
|
#4
|
|||
|
|||
|
I got it figured out. I it is because I have html before the php code and the web server confuses the two and thinks I have already submitted header information.
Solution: Take out all previous html to session_start. |
|
#5
|
||||
|
||||
|
The server confuses nothing. The code is parsed at the moment you call it in your file. But this is exactly what I meant. I struggled with it a long time before I got to the solution. Glad I could help...
Cheers, |
|
#6
|
|||
|
|||
|
I've seen alot of people adding this line as well:
PHP Code:
Seems to be some kind of IE6 fix. Thought it was worth mentioning. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > php/mysql header and session_start errors |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|