--- Jim MacDiarmid <[EMAIL PROTECTED]> wrote: > > How do I determine where this error is coming from? > > Warning: session_start(): Cannot send session cookie - headers already sent > by (output started at D:\Apache2\htdocs\friendship-cafe\constants.php:2) in > D:\Apache2\htdocs\friendship-cafe\includes\session.php on line 47 > > Warning: session_start(): Cannot send session cookie - headers already sent > by (output started at D:\Apache2\htdocs\friendship-cafe\constants.php:2) in > D:\Apache2\htdocs\friendship-cafe\includes\session.php on line 47 > > Jim
Sometimes I think we need an FAQ. This sort of error is definitely in the top 10 for PHP errors among newer programmers. When you are doing anything which makes use of HTTP headers, including writing cookies, session variables, or redirecting the browser with the header() function, you must not output any content to the HTTP body. This is different than the HTML body. The HTTP body output begins when you print or echo the first character. A blank line or space character before your first opening PHP tag can generate this sort of error. In your case, the error message tells you where to look: line 2 of constants.php. Make sure that the opening PHP tag is on the first line, first character position of the file. Make sure no print or echo statements are issued. Make sure that no errors are being generated by this file. Beyond this we can't help you since you provided no code for analysis. James _____ James D. Keeline http://www.Keeline.com http://www.Keeline.com/articles http://Stratemeyer.org http://www.Keeline.com/TSCollection http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc. Spring Semester Begins Jan 31 -- New Classes Start Every Few Weeks. Community email addresses: Post message: php-list@yahoogroups.com Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/