Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- session_start();
- if(isset($_POST['username']) || isset($_POST['password'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $_SESSION['username'] = $username;
- $_SESSION['password'] = $password;
- }
- if(isset($_SESSION['username']) || isset($_SESSION['password'])){
- $navbar = "1";
- $logindisplay = "0";
- $username = $_SESSION['username'];
- $password = $_SESSION['password'];
- } else {
- header('Location:http://website.com/fail.php');
- }
- $authed = auth($username, $password);
- if( $authed == "0" ){
- header('Location:http://website.com/fail.php');
- }
- session_start();
- if( isset($_POST['username']) && isset($_POST['password']) )
- {
- if( auth($_POST['username'], $_POST['password']) )
- {
- // auth okay, setup session
- $_SESSION['user'] = $_POST['username'];
- // redirect to required page
- header( "Location: index.php" );
- } else {
- // didn't auth go back to loginform
- header( "Location: loginform.html" );
- }
- } else {
- // username and password not given so go back to login
- header( "Location: loginform.html" );
- }
- session_start();
- session_regenerate_id();
- if(!isset($_SESSION['user'])) // if there is no valid session
- {
- header("Location: loginform.html");
- }
- session_start();
- unset($_SESSION['user']);
- session_destroy();
- header("Location: loginform.html");
- <?php
- session_start();
- if (isset($_POST['username']) && isset($_POST['password'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $authed = auth($username, $password);
- if (! $authed) {
- header('Location: http://website.com/fail.php');
- } else {
- $_SESSION['username'] = $username;
- }
- }
- if (isset($_SESSION['username'])) {
- $navbar = 1;
- $logindisplay = 0;
- } else {
- header ('Location: http://website.com/fail.php');
- }
- if (isset($_POST['username'] && isset($_POST['password'])) {
- if (auth($_POST['username'], $_POST['password'])) {
- $_SESSION['user'] = /* userid or name or token or something */;
- header(/* to next page */);
- } else {
- // display "User credentials incorrect", stay on login form
- }
- } else {
- // optionally: display "please fill out all fields"
- }
- if ($bAuthed)
- {
- header("location: login.php");
- }
- // error case
- header("location: error-login.php");
- session_start();
- if(isset($_POST['username']) || isset($_POST['password'])){
- $username = $_POST['username'];
- $password = $_POST['password'];
- $_SESSION['username'] = $username;
- $_SESSION['password'] = $password;
- }
- if(isset($_SESSION['username']) || isset($_SESSION['password'])){
- $navbar = "1";
- $logindisplay = "0";
- $username = $_SESSION['username'];
- $password = $_SESSION['password'];
- $authed = auth($username, $password);
- if( $authed == "0" ){
- header('Location:http://website.com/fail.php');
- }
- } else {
- header('Location:http://website.com/fail.php');
- }
- $password = $_POST['password'];
- $_SESSION['username'] = $username;
- $_SESSION['password'] = $password;
- $logindisplay = "0";
- $username = $_SESSION['username'];
- $password = $_SESSION['password'];
- header('Location:http://website.com/fail.php');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement