Hey, MrPancake here. I'm having a question about view pages while you are not logged in on the private message system.
In the tutorial is explained how to redirect to the login page if a session has not been set yet.
But what if i would make a profile page with the system and i would send some people a link to my profile so they could look at it?
then they need to login. so my question is how to make it like that, so if they go to the inbox page they wil be redirected to the login page, and if they go to the profile page they wont be redirected to the login page.
i hope thay you guys understand my question (english is not my best subject)
MrPancake,
Private message system page view thingy
Re: Private message system page view thingy
I got it,
just include:
just include:
if(empty($_SESSION['user_id']) && $_GET['page'] !== 'login'){ header("location: index.php?page=login"); die(); }at the pages where you need to be logged in.
Re: Private message system page view thingy
Sorry for the delay You should also be able to do that in the init.inc.php file if you are using it Either way is good.