SHARE
TWEET

assadsasa

failfail Apr 27th, 2016 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <form method="POST" action="entry.php">
  2.     <input name="log" class="test1" type="text" placeholder="Username"/><br/>
  3.     <input name="pass" class="test2" type="password" placeholder="password"/> <br/>
  4.     <button type="submit" id="btn" name="register">Sends</button>
  5.  
  6. </form>
  7.  
  8. <?php
  9. //include_once 'connection.php';
  10. $mysqli = new mysqli("localhost", "root", "", "userlistdb");
  11. $login = $_POST['log'];
  12.  
  13. $password = $_POST['pass'];
  14. $q = "SELECT * FROM usertbl WHERE username='".$login."'";
  15. $result = $mysqli->query($q);
  16.    
  17.  
  18. $myrow = $result->fetch_array();
  19.     if (empty($myrow["password"]))
  20.     {
  21.     exit ("<body><div align='center'><br/><br/><br/>
  22.     <h3>Извините, введённый вами login или пароль неверный." . "<a href='index.php'> <b>Назад</b> </a></h3></div></body>");
  23.     }
  24.     else {
  25.     if (password_verify($password, $myrow["password"])) {
  26.     //$_SESSION['login']=$myrow["login"];
  27.     //$_SESSION['id']=$myrow["id"];
  28.    echo 'поздравляем, вы зашли';
  29.     }
  30.    
  31.  else {
  32.     exit ("<body><div align='center'><br/><br/><br/>
  33.     <h3>Извините, введённый вами login или пароль неверный." . "<a href='index.php'> <b>Назад</b> </a></h3></div></body>");
  34.     }
  35.     }
  36.  
  37. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top