You are here: RE: [PHP] sending multiple headers (session_start() and setcookie() ) « PHP « IT news, forums, messages
RE: [PHP] sending multiple headers (session_start() and setcookie() )

Posted by Hans Zaunere on 01/09/05 02:59

> In my .php file, I'm using both session_start() and setcookie() before
> <html> tag. It gives me following warning message:
>=20
> Warning: Cannot modify header information - headers already sent by
> (output started at D:\Apache Group\Apache2\htdocs\YC\songs.php:4) in
> D:\Apache Group\Apache2\htdocs\YC\ycphpfunc.php on line 148
>=20
> My .php file looks like this:
>=20
> <?php session_start(); ?>
>=20
> <?php

Your output is started right there, above this <?php tag. There's no =
reason to break out of, and then back into, PHP processing. Just make =
it like this:

<?php

session_start();

ob_start();

....

?>
<html>
....
</html>


Also, be sure there is no whitespace at the end of the ycphpfunc.php =
file, or leave off the closing PHP tag completely.

---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org

 

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

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