//***********************************************************************************// //** Please leave this message alone, no one will be able to see it, except coders.**// // This script is copyrighted by PHP scripts, a Marsal Design Company.***************// // To get your own verison of this system, please do download it from our site*******// // located at http://www.free-php-scripts.net****************************************// // Script is free, no advertisement, no nothing....**********************************// //***********************************************************************************// session_start(); // ------------------------ Start Both ----------------------------------------------------- if($_COOKIE['logedin'] == 'yes' || $_SESSION['logedin'] == 'yes') { header("Location: members/welcome.html"); exit(); } // If the form was submited check if the username and password match if($_POST['Submit']){ if($_POST['username'] == 'admin' && $_POST['password'] == 'admin' ){ // ------------------------ Start Both ----------------------------------------------------- // If username and password is right , store the session in a cookie setcookie ('logedin', 'admin',time()+30000); // Set the length of the cookie to 30000 //Create the Session id's (as many as you want, can also do the same with cookied) $_SESSION['logedin'] = 'admin'; // Redirect to the page header("Location: members/welcome.html"); exit(); } else { $error = 'Password and/or Username Not Valid, Please Try Again!'; } } // :::::::::::::::::::NOTICE::::::::::::::::::: // You will have to put this code on top of any page you want to limit access to // // if($_COOKIE['logedin'] == NULL) { // header("Location: login.php"); // exit(); // } // To Log The Person Off The Session, Use The Logoff.php File included // ?>
|
|||||||||||||||||||||||||||||||||||
|
|