Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- mysql_connect("localhost", "root", "");
- mysql_select_db("blog1");
- ?>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="style/stylesheet.css"/>
- <title>Admin Login</title>
- </head>
- <body
- <div class="login">
- <?php
- if(isset($_POST['submit'])){
- $name = $_POST['name'];
- $pass = $_POST['password'];
- $query = "SELECT * FROM users WHERE name='".$name."' AND password='".$pass."'";
- echo $query
- $result = mysql_query("SELECT * FROM users WHERE name='".$name."' AND password='".$pass."'");
- $num = mysql_num_rows($result);
- echo $num;
- }else{
- ?>
- <p>Welcome to the Admin area</p>
- <p>please log in!</p>
- <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>
- </div>
- <?php
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement