Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <?php
  2. include("connection.php");
  3. session_start();
  4. ?>
  5. <HTML>
  6. <head>
  7. <title>Swift-Tournaments. Your tournament site</title>
  8. </head>
  9. <body>
  10. <?php
  11. if(!isset($_SESSION['username']))
  12. {
  13. ?>
  14. <a href="grappig.php">grappig</a>
  15. Meld u nu aan of <a href="registreer.php">registreer</a>
  16. <form action="index.php" method="post">
  17. username: <input type="text" name="username" /> <br />
  18. password: <input type="password" name="password" />
  19. <input type="submit" name="submit" value="submit" />
  20. </form>
  21.  
  22.  
  23. <?php
  24. if(isset($_POST["submit"]))
  25. {
  26. $username = $_POST["username"];
  27. $password = $_POST["password"];
  28. $result = mysql_query("SELECT * FROM users WHERE username= '$username'");
  29. while ($row = mysql_fetch_array($result))
  30. {
  31. if($_POST["password"] == $row["password"])
  32. {
  33. $_SESSION['username'] = $username;
  34. header('location: index.php');
  35. }
  36. else
  37. {
  38. header('location: forgot.php');
  39. }
  40. }
  41. }
  42.  
  43. }
  44. else
  45. {
  46. echo "welkom ". $_SESSION["username"];
  47.  
  48. }
  49. ?>
  50. </body>
  51. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement