Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- session question, please advice
December 6, 2005, 11:42 am
rate this thread
This is my code:
$korisnik = $username;
$sid = session_id();
wherever I put this code on my page i get the following errors:
Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at /xy/unos_reg.php:3) in /xy/unos_reg.php on line 4
Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at /xy/unos_reg.php:3) in /xy/unos_reg.php
on line 4
What am I doing wrong?
Re: session question, please advice
Session_start has to be called before any output is generated. The error
messages indicate that some ouput has occurred before the call to
1. make sure there is nothing in the php-file before the opening <?php,
not even a whitespace.
2. make sure there are no echo or print statements before your call to
session_start. Also check included files.