PHP Vs JS - Redirect

[php]<?php header('Location: index.php'); ?>[/php]

Vs.

[php]<?php echo ''; ?>[/php]

Discuss…

No reason to echo html, other than that, what’s to discuss? Practically everything in programming have multiple solutions, some equal, other may have pros/cons depending on use/implementation.

e.g. Sometimes when I used Headers I got an error “Headers already sent” so I resorted to a Javascript redirection.

Then you should fix the early output instead of hacking a fix ^^

Sponsor our Newsletter | Privacy Policy | Terms of Service