Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once("includes/mysql.php");
- if(isset($_POST['submit'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- // Assuming your hashing your passwords with MD5
- $password = md5($password);
- $query = "SELECT * FROM members WHERE username = '$username' AND password = 'password'";
- $action = mysql_query($query);
- $checkup = mysql_num_rows($action);
- if($checkup == 0) {
- // Login failed. Actions here.
- } else {
- // Login passed. Actions here.
- }
- }
- die();
- ?>
- <html>
- <head>
- <title>Login Form</title>
- </head>
- <body>
- <h1>Login!</h1>
- <form id="login" method="post" action="">
- Username: <input name="username" type="text" /> <br />
- Password: <input name="password" type="password"/> <br />
- <button type="submit" name="submit">Login!</button>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement