Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("connection.php");
- session_start();
- ?>
- <HTML>
- <head>
- <title>Swift-Tournaments. Your tournament site</title>
- </head>
- <body>
- <?php
- if(!isset($_SESSION['username']))
- {
- ?>
- <a href="grappig.php">grappig</a>
- Meld u nu aan of <a href="registreer.php">registreer</a>
- <form action="index.php" method="post">
- username: <input type="text" name="username" /> <br />
- password: <input type="password" name="password" />
- <input type="submit" name="submit" value="submit" />
- </form>
- <?php
- if(isset($_POST["submit"]))
- {
- $username = $_POST["username"];
- $password = $_POST["password"];
- $result = mysql_query("SELECT * FROM users WHERE username= '$username'");
- while ($row = mysql_fetch_array($result))
- {
- if($_POST["password"] == $row["password"])
- {
- $_SESSION['username'] = $username;
- header('location: index.php');
- }
- else
- {
- header('location: forgot.php');
- }
- }
- }
- }
- else
- {
- echo "welkom ". $_SESSION["username"];
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement