html - setcookie() has header problem -- no whitespace, text, or anything before the <?php tag -


the following code has no whitespace or text before opening php tag. when applied, warning says header has been called "on line 3" (setcookie). i'm @ loss why.

<?php     $value = 'something somewhere';     setcookie("testcookie", $value); ?>  <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head>     <meta http-equiv="content-type" content="text/html; charset=utf-8">     <title></title>  </head> <body>  </body>  </html> 

thank help.

if have saved file utf-8 bom (byte order mark) 3 charcters ouput @ start of file.

these characters tell (dumb) applications utf-8 file.

using bom not necessary applications.

http://en.wikipedia.org/wiki/byte_order_mark

if save file again without bom should fine.

not sure if what's happening without seeing actual file worth shot.

some editors show kind of file is. use editplus editor myself (windows) , shows encoding of file.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -