Guest User

login

a guest
Feb 5th, 2016
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Tek13login</title>
  4. </head>
  5. <body>
  6. <form action="tek13login.php" method="post">
  7. Username: <input type="text" name="username">
  8. Password: <input type="password" name="password">
  9. <br>
  10. <input type="submit" value="login">
  11. </form>
  12.  
  13. <?php
  14. $conn = mysql_connect('localhost', 'root', '') or die(mysql_error());
  15.  
  16. mysql_select_db('tek13login', $conn);
  17.  
  18. echo "Connect tek13login är okej.";
  19.  
  20. if(isset($_POST)) {
  21. $users = mysql_query("SELECT * FROM userinfo");
  22. while($row = mysql_fetch_array($users)) {
  23. if($row["username"] == $_POST["username"] && $row["password"] == $_POST["password"]) {
  24. echo "<br>Välkommen";
  25. }
  26. }
  27. }
  28. ?>
  29. </body>
  30. </html>
Add Comment
Please, Sign In to add comment