Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $user = "root";
- $pass = "pass";
- $db = "SheetPal";
- mysql_connect($host, $user, $pass);
- mysql_select_db($db);
- if (isset($_POST['submit'])){
- $username = $_POST['username'];
- $password = $_POST['password'];
- $sql = "SELECT * FROM users WHERE username ='".$username."' AND password = '".$password."' LIMIT 1";
- $res = mysql_query($sql);
- if(mysql_num_rows($res) == 1){
- echo "You have successfully logged in.";
- exit();
- }
- else {
- echo"Invalid login information.";
- exit();
- }
- }
- ?>
- <!DOCTYPE html>
- <html >
- <head>
- <meta charset="UTF-8">
- <title>Login Form</title>
- <link rel="stylesheet" href="css/login.css">
- </head>
- <body>
- <body>
- <div class="login">
- <div class="login-screen">
- <div class="app-title">
- <h1>Login</h1>
- </div>
- <div class="login-form" role="form" method="post" action="test.php">
- <div class="control-group">
- <input type="text" class="login-field" value="" placeholder="username" name="username">
- <label class="login-field-icon fui-user" for="login-name"></label>
- </div>
- <div class="control-group">
- <input type="password" class="login-field" value="" placeholder="password" name="password">
- <label class="login-field-icon fui-lock" for="login-pass"></label>
- </div>
- <div class="control-group">
- <input id="submit" name="submit" type="submit" value="Login" class="btn btn-primary">
- </div>
- <!-- <a class="btn btn-primary btn-large btn-block" href="test.php">login</a>
- <a class="login-link" href="#">Lost your password?</a> -->
- </div>
- </div>
- </div>
- </body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement