Are you getting this kind of error when creating a cookie or setting a cookie -
Warning: Cannot modify header information - headers already sent by (output started at e:\wamp\www\mysite\test.php:3) in e:\wamp\www\mysite\test.php on line 4
So setcookie or setrawcookie function should be the first to be called means,
setcookie or setrawcookie function should be the first line on your page.
So if you use code like this
some html tags here or other contents or data
<?php
setcookie( "cookiename", "cookievalue", time()+3600);
?>
so the above code will give error.
So you should do following thing.
So you should do following thing.
<?php
setcookie( "cookiename", "cookievalue", time()+3600);
?>
No comments:
Post a Comment