Guest User

Untitled

a guest
Dec 6th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <!--logout_parse.php-->
  2.  
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  4. <?php
  5.  
  6. include_once ("connect.php");
  7.  
  8. if(isset($_POST['username'])) {
  9.    
  10.     $username = $_POST['username'];
  11.     $password = $_POST['password'];
  12.  
  13.     $sql = "SELECT * FROM Login WHERE username='".$username."' AND password='".$password."'";
  14.  
  15.     $res = mysql_query($sql) or die (mysql_error());
  16.     $count= mysql_num_rows($res);
  17.     if($count == 1) {
  18.         $_SESSION["username"] = $username;
  19.         echo "<script>window.location = 'admin.php';</script>";
  20.     } else {
  21.         echo "Fel username eller password. <a href=login.php>Försök igen</a>";
  22.     }
  23.  
  24. }
  25.  
  26. ?>
Add Comment
Please, Sign In to add comment