Is it good practise to use meta refresh tags for redirects instead of header() function in php?
Posted
by
Kent
on Stack Overflow
See other posts from Stack Overflow
or by Kent
Published on 2010-12-25T05:21:48Z
Indexed on
2010/12/25
7:54 UTC
Read the original article
Hit count: 147
I have to use redirects a lot in my scripts, for example after a user logs in I need to redirect them to the admin area, etc. But I find it inconvenient to always have to have the header function at the very top. So if I use the meta refresh tags for my redirects, is that something that would be frowned upon according to best practices or is it acceptable?
function redirect($location) {
echo "<meta http-equiv='refresh' content='0; url=$location' />";
}
© Stack Overflow or respective owner