daily pastebin goal
21%
SHARE
TWEET

aaaa

failfail Apr 27th, 2016 94 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. $password = $_POST['pass'];
  13. $q = "SELECT * FROM usertbl WHERE username='".$login."'";
  14. $result = $mysqli->query($q);
  15.    
  16.  
  17. $myrow = $result->fetch_array();
  18.     if (empty($myrow["password"]))
  19.     {
  20.     exit ("<body><div align='center'><br/><br/><br/>
  21.     <h3>Извините, введённый вами login или пароль неверный." . "<a href='index.php'> <b>Назад</b> </a></h3></div></body>");
  22.     }
  23.     else {
  24.     if ($myrow["password"]==$password) {
  25.     $_SESSION['login']=$myrow["login"];
  26.     $_SESSION['id']=$myrow["id"];
  27.    echo 'поздравляем, вы зашли';
  28.     }
  29.    
  30.  else {
  31.     exit ("<body><div align='center'><br/><br/><br/>
  32.     <h3>Извините, введённый вами login или пароль неверный." . "<a href='index.php'> <b>Назад</b> </a></h3></div></body>");
  33.     }
  34.     }
  35. ?>
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