Jump to content

Archived

This topic is now archived and is closed to further replies.

humski

session error

Recommended Posts

hey guys, i recently signup to pay for my own share hosting, and already with my login file, i loaded it up and i get this error on top of my site.
[code]Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/utvsoyhd/public_html/game.php:7) in /home/utvsoyhd/public_html/game.php on line 9[/code]

and this was the codes

[code]<?php
include("conf/config.php");
session_start();
session_register( "session" );
?>[/code]

It's funny, because when i was still using it on free hosting service, no such error appeared. Could this have anything to do with server in cpanel? if so please help me set this out.

Thank You

humski

Share this post


Link to post
Share on other sites
[code=php:0]session_start();[/code] must be called before there is _any_ output sent to the user agent. Check for other error messages/notices and for any unwanted whitespace outside of [code=php:0]<?php ?>[/code] tags.

Share this post


Link to post
Share on other sites
You cant put anything before session start

[code=php:0]
<?php
session_start();
session_register( "session" );
include("conf/config.php");

?>
[/code]

Try reading the [url=http://www.phpfreaks.com/forums/index.php/topic,31047.0.html]PHP FAQs[/url] before posting

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.