Jump to content

login redirections


fife

Recommended Posts

check the persons level initially then, store it in a session, then when you want to check or redirect, just check the session and do so depending on what is stored

here is a simple one for my logged in or not

 

session_start();

function logged_in() 
{
	return isset($_SESSION['user_id']);
}

function confirm_logged_in() 
{
	if (!logged_in()) 
	{
		redirect_to("login.php");
	}
}

 

then i check if they are logged in by  confirm_logged_in()

but you could make a function that will always get the level by something like

 

$level= ($_SESSION['level']);

 

then use $level to redirect or whatnot

 

is fife a nickname?

 

Link to comment
https://forums.phpfreaks.com/topic/115643-login-redirections/#findComment-594490
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.