Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Tek13login</title>
- </head>
- <body>
- <form action="tek13login.php" method="post">
- Username: <input type="text" name="username">
- Password: <input type="password" name="password">
- <br>
- <input type="submit" value="login">
- </form>
- <?php
- $conn = mysql_connect('localhost', 'root', '') or die(mysql_error());
- mysql_select_db('tek13login', $conn);
- echo "Connect tek13login är okej.";
- if(isset($_POST)) {
- $users = mysql_query("SELECT * FROM userinfo");
- while($row = mysql_fetch_array($users)) {
- if($row["username"] == $_POST["username"] && $row["password"] == $_POST["password"]) {
- echo "<br>Välkommen";
- }
- }
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment