Jump to content

Use of header();


sepoto

Recommended Posts

if(!$_SESSION['logged_in'])  header("location:login.php?return=profile.php");//Set up if user's profile or if viewing a profileif(isset($_GET['uid']) && $_GET['uid'] <> "")	$uid = $_GET['uid'];else if($_SESSION['user_type'] == 2)  header("location:fan_profile.php");else   	$uid = $_SESSION['uid'];

I am trying to decipher the meaning of what is inside the ""'s. Doesn't '?' Usually mean a parameter is being passed?

header("location:login.php?return=profile.php");

Link to comment
Share on other sites

it's telling the browser to direct itself to login.php and to pass a query string where key is return and value is profile.php. Looks like profile.php will be the page the user is returned to if they complete the login process successfully? There's no way to know for sure without seeing login.php, but that's seems like the most likely case. profile.php is most likely going to be used as header redirect for some condition on login.php.

Link to comment
Share on other sites

Yes. I do believe all of that is correct. I will have another look at the code. Thank you for your help.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...