Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- mysql_connect("localhost", "root", "");
- mysql_select_db("blog1");
- ?>
- <html>
- <head>
- <title>Login</title>
- </head>
- <body>
- <?php
- if(isset($_POST['submit'])) {
- $name = $_POST['name'];
- $pass = $_POST['password'];
- $result = mysql_query("SELECT * FROM users WHERE name='$name' AND '$pass'");
- $num = mysql_num_rows($result);
- echo $num;
- } else {
- ?>
- <form action='login.php' method='post'>
- Username: <input type='text' name='name' /><br />
- Password: <input type='password' name='password' /><br />
- <input type='submit' name='submit' value='Login' />
- </form>
- <?php
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement