South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
@cbrunsdonza - I Stand to be corrected (I'm not a pro at this)
But most hosting providers servers are set not allow you to use header to redirect to another page when the page has already returned HTML code.
If you try it normally gives you
PHP:Warning: Cannot modify header information - headers already sent by Bla bla bla
It works on WAMP though.
Maybe its an attempt to save recources
Oi Vey!Come here and collect your slap !!!!
That is the worst code in the world. You never ever do a redirect header call without an exit/die afterwards else you will still execute the remaining PHP code. I've seen "professional" development companies do this on form submissions and cannot understand why their code still executes.
Code:if(!isset($_GET['id'])) { header("location: index.php"); [B] die(); // or use exit; [/B]}