Hi, I use php's header() function for redirection users, using header('Location: some_location');In the php manual, it says:
An example of incorrect usage of header() is also given in the same manual:<html><?php/* This will give an error. Note the output* above, which is before the header() call */header('Location: http://www.example.com/');?>
BUT, if i paste the exact same code in somefile.php, and then navigate to that file, i do not get an error....Besides, i have used header() in my own site multiple times after outputting content (html elements, text), and yet no error, until today...Today, i inserted a second img using <img src=...> on the same page, and when i try to send the header('Location: ...') now, i get the error of 'headers already sent'. But if i do not include that second <img> element (so only one <img> is used on the site), then no error is given... . I am very confused because of this, the function (and it's corresponding error) is not working as it should... Can somebody please clarify?