Jump to content

page validation


ypran

Recommended Posts

Yep as said above, ull need sessions or cookies to handle login state. So a simple example should be:

 

login

<?php
session_start();
if($login){ //this is your login validation
    $_SESSION['login'] = true;
} else{
    echo 'The username and password are incorrect';
}
/>

 

session check on other pages

<?php
session_start();
if(isset($_SESSION['login'])){
    //show some info
} else{
    die('You must be logged in to access this section');
}
?>

Link to comment
https://forums.phpfreaks.com/topic/104540-page-validation/#findComment-535122
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.