View Full Version : User Validation Quesion

10-08-2008, 03:23 AM
Im making a user login page that protects webpages. If the user enter's in the right combination of strings on login page, it lets them go to 'mypage1'. However, if the user were to just type in the url for 'mypage1' (mypage2, mypage3, etc) it would let them access it. How do i make sure the users have gone through validation to view any of 'mypages'.

10-08-2008, 12:42 PM
Use sessions — set a session value when they log in, and check that the value is set on the protected page.

10-08-2008, 03:23 PM
Thank you for the quick response.
Im not entirely sure how to do this without using a mysql database.
any help would be greatly appreciated.

10-08-2008, 03:28 PM
Simply put <?php session_start(); ?> at the top of the page, and use the array $_SESSION as you would any other array.