This is a discussion on Session Error within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, the following php-snippet: <? // Fahrzeugverwaltung // index.php session_start(); // user-check if (!isset($_SESSION['status'])) { session_write_close(); header("Location: ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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! |
|
|||
|
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/function.session-start?PHPSESSID=5b6f958962576f38bbee30f991d04c3e>/]: > 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- |
|
|||
|
"David Haynes" <david.haynes2@sympatico.ca> schrieb im Newsbeitrag
news:ZZtxg.13308$Sc.8406@fe23.usenetserver.com... > 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/funct...ID=5b6f9589625 76f38bbee30f991d04c3e>/]: > > 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- Thank you David - but (unfortunaly) the short tag in on. |