Advertisement
Guest User

Untitled

a guest
Oct 24th, 2015
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.20 KB | None | 0 0
  1. <form method="POST">
  2. <input type="text" name="username" placeholder="Username">
  3. <input type="password" name="pass" placeholder="Passwort">
  4. <input type="password" name="security" placeholder="Securitycode">
  5. <input type="submit" name="submit" value="Einloggen">
  6. </form>
  7.  
  8. <?php
  9.  
  10. if(isset($_POST['submit']))
  11. {
  12. if(isset($_POST['username'], $_POST['pass'], $_POST['security']))
  13.   {
  14.       if(!empty($_POST['username']) && !empty($_POST['pass']) && !empty($_POST['security']))
  15.       {
  16.     $hkusername = $conn->real_escape_string($_POST['username']);
  17.     $hkpassword = HoloHashMD5($_POST['pass']);
  18.     $hksecurity = $conn->real_escape_string($_POST['security']);
  19.    
  20.    
  21.     $query = $conn->query("SELECT * FROM users WHERE username LIKE '".$hkusername."' AND password LIKE '".$hkpassword."' AND secretcode LIKE '".$hksecurity."'");
  22.     $acpq = $query->fetch_array();
  23.    
  24.     if($query->num_rows > 0)
  25.     {
  26.         if($name == $acpq['username'])
  27.         {
  28.             $_SESSION['hksession'] = $acpq;
  29.             header("Location: startseite.php");
  30.         }
  31.         else
  32.         {
  33.             $error = "Falsche Logindaten";
  34.         }
  35.     }
  36.       }
  37.   }
  38.   else{
  39.       $error = "Nicht alle Felder ausgefüllt";
  40.       }
  41. }
  42.  
  43. ?>
  44.  
  45. <?php
  46. if(isset($error)){
  47.             echo $error;
  48.         }
  49.         ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement