Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head><link rel="stylesheet" type="text/css" href="style.css" /></head>
- <body>
- <div id="container">
- <form method="post">
- <p>Username: <input type="text" name="username" /></p>
- <p>Password: <input type="password" name="password" /></p>
- <h1><input type="submit" name="submit" value="Log in" /></h1>
- </form>
- <?php
- if(isset($_POST['submit']))
- {
- $con = mysql_connect("localhost","robin_1","banaan");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("robin_test",$con);
- $login = mysql_query("SELECT * FROM login
- WHERE username = '" . $_POST['username'] . "' AND password = '" . $_POST['password'] . "'");
- if (!$login == "")
- {
- echo "Login succesfully.";
- }
- else
- {
- echo "Failed to log in.";
- }
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement