php session login pages not hidden
As I seem to be getting quick answers to problems on here rather than some other coding specific forums I thought I'd post my latest problem up here incase anyone has any answers
I have a site that users have to log into to view their own members area.
The site uses sessions so when a user logs in the pages such as www.mysite.com/account.php show the users details.
However, if someone is NOT logged in and they just go to www.mysite.com/account.php they can still view the whole page but with all the bits that contain a users details are empty.
How do I make it so that these pages are not able to be viewed when a user is not logged in and that the user get's prompted to enter their username and password to login and view it properly?
Is it simply a case of do an "if session value = 0 then display log in box"?
Cheers
Wardy
|