Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?php
  2. if(isset($_GET["login"]) && isset($_GET["password"]))
  3. {
  4. $login=$_GET["login"];
  5. $password=$_GET["password"];
  6. //@mysqli_connect('localhost:3306','root','') or die("serwer");
  7. //@mysqli_select_db('ola') or die ("baza");
  8. $dbServer = 'localhost';
  9. $dbUser = 'root';
  10. $dbPassword = '';
  11. $dbName = 'ola';
  12. $mysqli = new mysqli($dbServer,$dbUser,$dbPassword,$dbName);
  13. $result=mysql_query("SELECT `password` FROM `users` WHERE login='$login'");
  14. if (mysql_num_rows ($result) !=0)
  15. {
  16. $row= mysql_fetch_array ($result);
  17. if ($password== $row[0])
  18. echo "udalo sie zalogowac";
  19. else
  20. echo "bledne haslo";
  21. }
  22. else echo "bledny login";
  23.  
  24.  
  25. }
  26.  
  27.  
  28.  
  29. ?>
  30.  
  31.  
  32. <form method=get action=index.php>
  33. <input type=text name=login>
  34. <input type=text name=password>
  35. <input type=submit value=loguj>
  36.  
  37. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement