Jump to content

Proper Redirect


onlyican

Recommended Posts

I am building the part of my website which checks if a user has the right access level to be on that page

If there not, I will redirect them to a Log In Page

I will do this by

<?php
header("Location: ".root.".login.php";
?>

BUT
If I am redirecting someone, dont I need some more headers

Whats is the proper headers for redirecting someone to a diff page
Link to comment
https://forums.phpfreaks.com/topic/30272-proper-redirect/
Share on other sites

it states on the php.net site
[quote]
The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless some 3xx status code has already been set.
[/quote]

I dont want a 302 Redirect
So I need some 3xx Status Code??
Link to comment
https://forums.phpfreaks.com/topic/30272-proper-redirect/#findComment-139299
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.