Advertisement
Guest User

Untitled

a guest
May 2nd, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3. mysql_connect("localhost", "root", "");
  4. mysql_select_db("blog1");
  5. ?>
  6. <html>
  7. <head>
  8. <link rel="stylesheet" type="text/css" href="style/stylesheet.css"/>
  9. <title>Admin Login</title>
  10. </head>
  11. <body
  12.  
  13. <div class="login">
  14. <?php
  15. if(isset($_POST['submit'])){
  16. $name = $_POST['name'];
  17. $pass = $_POST['password'];
  18. $query = "SELECT * FROM users WHERE name='".$name."' AND password='".$pass."'";
  19. echo $query
  20. $result = mysql_query("SELECT * FROM users WHERE name='".$name."' AND password='".$pass."'");
  21. $num = mysql_num_rows($result);
  22. echo $num;
  23. }else{
  24. ?>
  25. <p>Welcome to the Admin area</p>
  26. <p>please log in!</p>
  27. <form action='login.php' method='post'>
  28. Username: <input type='text' name='name' /><br />
  29. Password: <input type='password' name='password' /><br />
  30. <input type='submit' name='submit' value='login!' />
  31. </form>
  32. </div>
  33. <?php
  34. }
  35. ?>
  36. </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement