Require login to view secure pages

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
wbryan6
Forum Newbie
Posts: 22
Joined: Sat Feb 04, 2006 12:13 pm

Require login to view secure pages

Post by wbryan6 »

I have an administrative portion of my site where I can login to add and delete information from my database, but the problem is that if someone were to just type the secure url they would be admitted to the page. How do I make this secure and require that the person login before they can view certain pages? Thanks.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

When you log in you need to start a php session

read: http://www.php.net/sessions


Check for the existance of a valid session on each page you want to protect


This has been discussed in great lengths on these boards before so try a search if you get stuck
Post Reply