Just like the question states, earlier today I solved a bug in my code by replacing a javascript redirect with a php redirect:
header('Location: index.php')
The only way I could accomplish this was by replacing every echo
in my code with print
. By doing this I was allowed to use the header()
call.
I'm interested to know if this is bad practice, and if so, why?