Going through the php.net site, it had an example for header, which says would give me error. I copied it, and executed on on WAMP, but it didn’t showed me any error, but did redirect to the site.
<html>
<?php
/* This should give an error (but it doesn't!). Note the output
* above, which is before the header() call */
header('Location: http://www.example.com/');
?>
Just wanted to know, if its a right behavior on my WAMP, or its an error, or if I have any particular settings active in php.ini file which is making this work!!!. Let me know if anyone needs my php.ini to be copied here!!
Thanks,
Tanmay
It sounds like you have output_buffering enabled.
http://php.net/manual/en/outcontrol.configuration.php
Standard configuration would be to error because data has already been output, and headers need to come first. Output buffering would allow headers to appear in code after other output, but it would still output the headers first due to the buffer.