Forum Moderators: coopster

Message Too Old, No Replies

protected pages with php

         

o trenseta o

5:56 am on Jul 17, 2004 (gmt 0)

10+ Year Member



hi,

Im having trouble with a password protected page.
My problem is how do i define the session for the whole page.

this is what i have after someone logs in. But don't kno if its correct/Also do i have to include the login form again incase they just try and type in the url to get in?

<?
session_start();
?>
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>

If someone a bit more fluent with php could lend some advice it would be great.

kind Regards

jatar_k

5:47 pm on Jul 17, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You will need to test the session to see if the variables you set there are correct. If they are not kick them out, unset the session and send them to the login page.

o trenseta o

1:55 am on Jul 19, 2004 (gmt 0)

10+ Year Member



so just chek to see if the username and passwords var's have been filled in?

coopster

12:14 pm on Jul 19, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Sure, that's one way of doing it. I'll often check the password against the stored password on each page though just to make sure an administrator hasn't disabled or changed it on the user for some reason.