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="stylegsheet" type="text/css"
- href="style/stylesheet.css"/>
- <title>Admin 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='$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>
- <?php
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement