Jump to content

[SOLVED] Quick question about log in form


hackerkts

Recommended Posts

I have written a login page, login.php, And I have a protected page(only logged in users are allow to view) which will require login.php on the very first line.

 

Which one of these methods is the best?

  • On the login.php put exit(), so if not authorized user access protected page it will only show the login form and cut of the rest of the page, it also cuts of body and html's tag.
  • Make use of if else statement on protected page

 

Anyone answer(s) is appreciated,

thanks!

Link to comment
Share on other sites

I have a query and an if statement that checks for a valid user logged in and matches it with the data in the database at the top of all my protected pages. I use the SESSION in my where clause to identify the user that was logged in at login page. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.