Jump to content


Photo

session error


  • Please log in to reply
2 replies to this topic

#1 humski

humski
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 15 August 2006 - 10:11 AM

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.
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

and this was the codes

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

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

#2 Jenk

Jenk
  • Members
  • PipPipPip
  • Advanced Member
  • 778 posts

Posted 15 August 2006 - 10:17 AM

session_start();
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
<?php ?>
tags.

#3 sanfly

sanfly
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationNew Zealand

Posted 15 August 2006 - 10:18 AM

You cant put anything before session start

<?php
session_start();
session_register( "session" );
include("conf/config.php");

?>

Try reading the PHP FAQs before posting
If you're not part of the solution, you're part of the precipitate




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users