Jump to content

Login interface??


common

Recommended Posts

Hi all!

 

I want to create a login interface but i am not sure whats the right procedure. When the person login, for example with a username and password, its been checked by an if else statement,correct? But to where do i direct the the user? because if I only direct it to another page,its not really secure, because I can only put the other page name in the address bar...so how do I secure it??

 

Thanx

Link to comment
https://forums.phpfreaks.com/topic/164102-login-interface/
Share on other sites

Generally you would use sessions to store a variable once the user has logged in, then the page you're redirected to will have something like

 

<?php

if(!isset($_SESSION['validuser'])) {
header("Location: loginpage.php");
}

?>

 

Which will check for your session variable, if it isn't set, you know the person is not logged in yet, so you just send them back to the login page.

 

Link to comment
https://forums.phpfreaks.com/topic/164102-login-interface/#findComment-865676
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.