English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I received message:Warning: Cannot modify header information - headers already sent by (output started at......) when i run my website.I have checked space before and after ...But i received above massage.I remove all of code and wrote :
header(location: http://www.yahoo.com);
?>
But it still dont run and i still received above message.
Can you help me? Thanks

2006-08-07 07:17:03 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

header("Location:login.php");
exit();

2006-08-07 07:22:33 · answer #1 · answered by Anonymous · 2 0

first, there can be nothing returned before your PHP block (white space included).

Second the correct way to call that is - header("Location: {website}"); (note the capitalized Location).

2006-08-07 07:35:37 · answer #2 · answered by John J 6 · 0 0

Make sure that the location is Location (I don't know if it is picky about that) and that everything in the parenthesis is in quotes, like:

header("Location: http://www.yahoo.com");

So the whole page should be:

header("Location: http://www.yahoo.com");
?>

And nothing else. There shouldn't be anything else before the header.

2006-08-07 07:23:32 · answer #3 · answered by Bryan A 5 · 0 0

You can also try output buffering:


ob_start();
header("Location: ...");

... other stuff ...

ob_end_flush();
?>

2006-08-07 08:55:37 · answer #4 · answered by pmp 2 · 0 0

fedest.com, questions and answers