Jump to content

Help with User Login on index.php includes


craigj1303

Recommended Posts

Hi All

 

I developed a site using PHP & a MYSQL database. From the off I structured the site by routing everything through index.php. This way the page shell (banner, navigation etc) is always consistent and I use includes for the various page contents.

 

This has been fine up until now. But now I am designing in a new aspect to the site which requires a user to login to view some content. Now, the problem is that I want to check if the user has logged in before certain content is displayed, and I have a confirm_login() function that checks if a $_session variable has been set for login. If the login $_Session variable hasn't been set the user is diverted to the login page. But this confirm_login() function requires me to check for a user login on every page and I only need the user to be logged in for a few secure pages. But as everything is routed through index.php how can I best handle this?

 

Regards

 

Craig

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.