Posted by J.O. Aho on 12/06/05 14:03
Zvonko wrote:
> Hi!
>
> This is my code:
> <?php
> session_start();
> session_register("korisnik", "sid");
> $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
You have to see to that you don't have any white spaces (space, tab) or any
other text (characters) like HTML code before you the <?PHP.
If you have include() or similar functions, then you have to see to that there
aren't anything before <?PHP or/and after ?> in those included files.
The
<?php
session_start();
session_register("korisnik", "sid");
$korisnik = $username;
$sid = session_id();
?>
should be the first thing you do in your script.
//Aho
[Back to original message]
|