For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > July 2006 > Session Error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Session Error
Michael Maus

2006-07-25, 6:56 pm

Hi,

the following php-snippet:

<?
// Fahrzeugverwaltung
// index.php
session_start();

// user-check
if (!isset($_SESSION['status']))
{
session_write_close();
header("Location: login.php");
}

[...]

?>

produces:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /kunden/crea.de/webseiten/kunden/hmwa/index.php:1) in //webseiten/kunden/index.php on line 4

(Linux System)

I don't see, where a "<?" or two comment-lines could cause a header-output?

Thank you for any help!



David Haynes

2006-07-25, 6:56 pm

Michael Maus wrote:
> Hi,
>
> the following php-snippet:
>
> /<?
> // Fahrzeugverwaltung
> // index.php
> session_start();/
> //
> /// user-check
> if (!isset($_SESSION['status']))
> {
> session_write_close();
> header("Location: login.php");
> }/
> //
> /[...]/
>
> /?>/
>
> produces:
>
> /Warning: session_start() [//function.session-start/
> <http://www.crea.de/kunden/hmwa/func...91d04c
3e
>/]:
> Cannot send session cache limiter - headers already sent (output started
> at /kunden/crea.de/webseiten/kunden/hmwa/index.php:1) in
> //webseiten/kunden/index.php on line 4/
>
> (Linux System)
>
> I don't see, where a "<?" or two comment-lines could cause a header-output?
>
> Thank you for any help!
>

Do you have short tags enabled in your php.ini?
If not, <? should be <?php and <? would be the start of output.

-david-

Michael Maus

2006-07-26, 3:57 am

"David Haynes" <david.haynes2@sympatico.ca> schrieb im Newsbeitrag
news:ZZtxg.13308$Sc.8406@fe23.usenetserver.com...
> Michael Maus wrote:
<http://www.crea.de/kunden/hmwa/func...SID=5b6f9589625
76f38bbee30f991d04c3e>/]:[color=darkred]
header-output?[color=darkred]
> Do you have short tags enabled in your php.ini?
> If not, <? should be <?php and <? would be the start of output.
>
> -david-


Thank you David - but (unfortunaly) the short tag in on.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com