Guest User

Logg inn shit

a guest
Jan 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. if(isset($_POST)&&!empty($_POST) {
  5.     $_username = "knut";
  6.     $_password = "123";
  7.    
  8.     $username = $_POST['username'];
  9.     $password = $_POST['password'];
  10.  
  11.     if($username == $_username && $password == $_password) {
  12.         $_SESSION["loggedin"] = "1";
  13.     }
  14. }
  15. if(!isset($_SESSION["loggedin"])) {
  16.     <form action="">
  17.         <input type="text" placeholder="Brukarnavn"></input>
  18.         <input type="password" placeholder="Passord"></input>
  19.         <input type="submit" value="Logg inn">
  20.     </form>
  21. } else {
  22.     <form action="LINK TIL SCRIPT">
  23.         <input type="submit" value="Koyr script">
  24.     </form>
  25. }
  26. ?>
Add Comment
Please, Sign In to add comment