Forum Moderators: coopster

Message Too Old, No Replies

page protection

page security

         

deKing

10:35 pm on Sep 22, 2008 (gmt 0)

10+ Year Member



hi, I am working on php / mysql using XAMPP. i have created a login interface of which the users are authenticated in the database. however, a user that knows the full path of the other links can either copy and paste the path on a browser or just type in the full path and get access to the other interfaces. how do i prevent that from occuring. I want every user authenticated before accessing the other interfaces (pages)and if peradventure a user decides to take a short cut, it should be redirected to the login page or generate an error message.

can anyone assit? cheers
deking

eelixduppy

10:56 pm on Sep 22, 2008 (gmt 0)



Hello and Welcome to WebmasterWorld!

If you are setting a session variable upon authentication you can check to see if that exists in the beginning of the script:


if(![url=http://www.php.net/isset]isset[/url]($_SESSION['auth']))
[url=http://www.php.net/header]header[/url]("Location: http://www.example.com/login.php");
[url=http://www.php.net/exit]exit[/url];
}

Try something like that and see how it works out for ya. :)