stop ppl from entering page without login

They have: 164 posts

Joined: Nov 2001

i have a login.php, if login success, it will go to index.php.
if a person type index.php, it can straight away go to the index page without login.

anything that i can do in order to stop this frm happening??

Busy's picture

He has: 6,151 posts

Joined: May 2001

change login to index.php, and if successful go to login.php

They have: 164 posts

Joined: Nov 2001

they might login the first time, and they will then know after login, wat page it will bring them to. then the next time, they will not login anymore...any prevention from this?

Busy's picture

He has: 6,151 posts

Joined: May 2001

my minds gone blank on the correct do da, its !isset to check whether the password has been added, you could also do a if else
at the top of your login page (after index), something like:

if (!$password || !$username) { show login form }
else { welcome to the pages content }

which means if passowrd or username is empty show the login form, otherwise show the page

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.