How can I make the header("Location: /path"); to only redirect once?
Currenlty I have this:
//If account is locked by user.
if($userdata['account_locked'] == 1):
header("Location: /account/locked");
endif;
This script is checked in my header file. But it doesn’t work, since it will just create a loop-redirect (infinit loop)
How can I do, so it only redirect once?
Thanks in advance.
This is simple, but it’s a bit ugly…
You should use MVC, a controller should be aware of the loop.
EDITED
It’s better to use
instead of
Edit: Changed from URL to URI.