You are here: Re: PHP headers not working :( « All PHP « IT news, forums, messages
Re: PHP headers not working :(

Posted by Dennis de Wit on 08/17/06 07:42

Sonia Covarrubias wrote:
> Ok.. to clarify, here's a code sample..
>
> <?php
> session_start();
> ?>
> <html><head><title>Session Test Page</title></head>
> <body>
> <h1>Session Test Page!</h1>
> <p>
> <?php
> echo '<b>session id:</b> '.session_id()."<p>";
> $_SESSION['testvar'] = 'hello';
> echo '<b>session variables:</b> ';
> print_r($_SESSION);
> ?>
> </body></html>
>
> Here's the error message:
>
> Warning: session_start() [function.session-start]: Cannot send session
> cookie - headers already sent by (output started at
> C:\htdocs\php\sessiontest.php:1) in
> C:\htdocs\php\sessiontest.php on line 2
>
> Something is wrong?
>
>
>

Check for enters on the top of your page (before the <?php tag). There
shouldn't be any...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация