$username = "username"; // The user name eg "ScHwErV_Family" $password = "password"; // The password // You can pull this from MYSQL as well. I will post the code if you like. if(isset($_POST['username']) && isset($_POST['password'])){ //user name and pass word was sent if($_POST['username'] == $username && $_POST['password'] == $password){ //they are correct $_SESSION['username'] = $_POST['username']; $_SESSION['password'] = $_POST['password'] //set the session data } } if(isset($_SESSION['username']) && isset($_SESSION['password]) ){ //session data set be the above or from a previous visit to the server //the page content is put here. } else { //the session is not set we need them to log in echo(' <form class="post" action="" method="POST"> <div>Username:<div><input type="text" name="username"></div></div> <div>Password:<div><input type="password" name="password"></div></div> <input type="submit" value="Login"> </form> '); }
If I did not have projects coming out my ears, I would join this one. What you did looks really nice thenotch.
Edited by Michael, 02 December 2006 - 01:48 AM.