math Posted November 18, 2008 Share Posted November 18, 2008 heya all, ive searched the whole internet for days.... It's this easy that they don't create it annymore or something, What i need is a page, that ask's only 1 password and u click on ok/send it directs to a other page. (Iff password's corroct ofcourse) Ive seen 37 scripts... they are more like member/register and so on... and all the scripts dont send you to a webpage directly.. they send you to the same page (other area) with a link to the desired page.. Can someone help me? I will be very happy to have a link/script Quote Link to comment https://forums.phpfreaks.com/topic/133183-easy-password-login/ Share on other sites More sharing options...
revraz Posted November 18, 2008 Share Posted November 18, 2008 Not sure what you mean really. Just hard code the PW and use a redirect. Quote Link to comment https://forums.phpfreaks.com/topic/133183-easy-password-login/#findComment-692653 Share on other sites More sharing options...
Guardian-Mage Posted November 18, 2008 Share Posted November 18, 2008 login page <?php $PASSWORD = "secret password here"; if (isset($_POST['pass'])) { if ($_POST['pass']) == $PASSWORD) { session_start(); $_SESSION['pass'] = true; header("Location: other_page_path_here.php"); exit(); } else { echo <<<ABC <strong style="color:red;">Looks like you entered the wrong password</strong> <form method="post"> <input type="password" name="pass" /> <input type="submit" value="Login" /> </form> ABC; } } else { echo <<<ABC <form method="post"> <input type="password" name="pass" /> <input type="submit" value="Login" /> </form> ABC; } ?> other page <?php session_start(); if (!isset($_SESSION['pass'])) { //Without a password, redirect to login script header("Location: login_script_path_here.php"); exit(); } ?> //HTML And rest of page here Quote Link to comment https://forums.phpfreaks.com/topic/133183-easy-password-login/#findComment-692734 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.