RE: sending multiple headers (session_start() and setcookie() )

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux