Advertisement
Guest User

Untitled

a guest
May 9th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. $port = 3306;
  4. $username = "hauale16_anwarz";
  5. $password = "webprosjekt123";
  6. $name = "hauale16_webprosjekt";
  7. $host = "tek.westerdals.no";
  8.  
  9. $connection = new PDO("mysql:host={$host};dbname={$name};port={$port};charset=utf8", $username, $password);
  10.  
  11. $statement = $connection->prepare('SELECT * FROM login_server');
  12.  
  13.  
  14. while($row = $statement->fetch(PDO::FETCH_ASSOC)) {
  15. $row;
  16. }
  17.  
  18. echo $row['password'];
  19.  
  20. if (($row['username'] == $_POST['user']) && ($row['password'] == $_POST['pass'])) {
  21. echo "login success!!!";
  22. } else {
  23. echo "failed to login!";
  24. }
  25.  
  26.  
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement