![]() |
cannot modify header -plz help-
hey i use this code
im gonna post here a part of it its an HTML code then php then html PHP Code:
Warning: Cannot modify header information - headers already sent by (output started at /home/karimweb/domains/SITE/login.php:4) in /home/karimweb/domains/public_html/SITE/login.php on line 189 Warning: Cannot modify header information - headers already sent by (output started at /home/karimweb/domains/public_html/SITE/login.php:4) in /home/karimweb/domains/public_html/SITE/login.php on line 190 Warning: Cannot modify header information - headers already sent by (output started at /home/karimweb/domains/public_html/SITE/login.php:4) in /home/karimweb/domains/public_html/SITE/login.php on line 191 and the navigator douesnt register the cookies the lines 189 and 190 and 191 are the lines where i write the code to register cookies on the browser |
do this
PHP Code:
|
i did it and it give the number 1 !
|
You need to have the PHP above the HTML. Send the headers before anything else, even a blank space, gets sent to the browser. Otherwise, as it's telling you, the headers have already been sent and they can't be set or re-sent after that point.
Code:
<?php /* send your headers */ ?>-m |
but the html code MUST be before the php
so i can mix design and php |
you can use output buffering to prevent this too. try ob_end_clean.
or you could do $header_%theheadernamehere% = header("fff"); |
Quote:
Either way, you don't have much of a choice. You cannot send a header after HTML has already been sent, and there is no way around that. Output buffering offers you a kind of alternative, but really there shouldn't be a need for it. -m |
so can u write here a little exemple plz
|
Cookies can only be created before the end of the headers. The headers end right before content is outputted or you end the HTML <head> tag.
Quote:
|
Quote:
|
Quote:
|
| All times are GMT. The time now is 03:36 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0