header("location: http://...");

Oleg Butuzov

New member
Òû óæå ïîñëàëà õåäåðè ,èõ íåëüçÿ ïîñûëàòü ïîñëå òîãî êàê òû íàïèøåøü ÷òî òî â áðàóçåðå...
 
First of all:
I understand enough french to know what you are asking...
Riiiight buddy, you don't know a word french, you were just reading his error message, that's what I say... ;)

But anyway... There is a way to keep php from sending all parsed material directly...
Code:
ob_start();
If you call the above function at the top of the page, the parsed info will only be "flushed" (sent to the user) when the buffer exceeds its storage limit, at the end of the page, or when you command it to...

Happy php-ing... =)

This way you can use functions such as header() to send the user to another page when the script has already sent some html code...
 
It is necessary to send any HTTP headers before you write any html

eg if you write
Code:
echo('something');
header('location: http://somethihg');

This will create a error
hence do not write any html tag before the header info
Code:
<?php
header('location: http://somethihg');
 
Back
Top