Pages: [1]   Go Down
Send this topic | Print
Author Topic: Question about PHP errors.  (Read 926 times)
kriššyafc
Super Authority member
******
Offline Offline

Posts: 1946


« on: October 07, 2007, 10:53:30 PM »

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/settings.php:2) in /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/login.php on line 14

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/settings.php:2) in /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/login.php on line 14

Warning: Cannot modify header information - headers already sent by (output started at /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/settings.php:2) in /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/login.php on line 16

whats dose this mean

Also you must specify a topic subject krissyafc.... ~Diemux
« Last Edit: October 08, 2007, 12:21:08 AM by Diemux » Logged

antimatter15
Loyal 110MB Member
*******
Offline Offline

Posts: 4014


WWW
« Reply #1 on: October 07, 2007, 10:58:35 PM »

it means you already did something like

echo "stuff";

before doing a function like:

header("stuff")
or
setcookie("stuff")
or
session_start()

i'm not sure if this would work, but maybe adding ob_start("gzhandler"); and ob_end_flush() at the beginning/ end would fix it.
Logged

Ajax Animator, a web-based, collaborative animation authoring environment with Flash, Silverlight, and GIF export.
bind
just a man
Authority Member
****
Offline Offline

Posts: 899



« Reply #2 on: October 07, 2007, 11:17:13 PM »


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/settings.php:2) in /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/login.php on line 14

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/settings.php:2) in /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/login.php on line 14

Warning: Cannot modify header information - headers already sent by (output started at /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/settings.php:2) in /www/110mb.com/h/y/b/r/i/d/t/u/hybridtube/htdocs/login.php on line 16

whats dose this mean

it means the session has been started after php has sent output to the browser.

start the session prior to the output if at all possible, because the output buffering mentioned adds considerably to the server resource usage.

its more efficient coding practices.

start sessions immediately in app (pre include/required or in an include/required class that always used, like a config file or security class) script is usually a good practice.

also, using an arguement in includes and requireds is a good thing just in case one is called that starts a session if the session is already started, then it wont throw up an error.

example:

Code:
<?php
#
# starts a session only is one isnt already set/started
#
if (!isset($_SESSION))
     {
          
session_start();
     }
?>


... can prevent many session already started errors when working with includes and requireds start sessions in them if they were already started previously
« Last Edit: October 07, 2007, 11:19:13 PM by bind » Logged

Learn the basics, create your code, then post source code to troublshoot if you have any problems

Here is all you need to learn the basics

HTML
Javascript
CSS
PHP
MySQL



.
Pages: [1]   Go Up
Send this topic | Print
Jump to: