header('location: ..') is not working in PHP

It happens if you are echo-ing text to the browser before sending the header('location').
You can not send content to your browser before executing a header(), as your echo will force a header to be sent.

Comment these lines out and check if it works:

// echo $variable;
// print_r($array);

Now your header will be sent and you will be redirected.


Popular posts from this blog

About 12 Alwars

Post thumbnails from external URLs don’t appear in Blogger. How to resolve?

What is the unicode character for the close symbol?