Advertisement
Guest User

Untitled

a guest
Mar 6th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. <body>
  2. <div class="container">
  3. <form id="signup" method="post" action="">
  4. <div class="header">
  5. <img src="admin/adminpanel.png">
  6.  
  7. </div>
  8.  
  9. <div class="sep"></div>
  10.  
  11. <div class="inputs">
  12. <input type="text" placeholder="Username" name="admin-username" />
  13. <input type="password" placeholder="Password" name="admin-password" />
  14.  
  15. <input type="Submit" Value="Sign Up"/>
  16. </div>
  17. </form>
  18. </div>
  19.  
  20.  
  21. <?php
  22. @mysql_connect('localhost', 'root', '');
  23.  
  24. $select_db = mysql_select_db('register');
  25.  
  26. session_start();
  27.  
  28. if (isset($_POST['admin-username'])){
  29. $username = $_POST['admin-username'];
  30. $password = $_POST['admin-password'];
  31.  
  32. $query = "SELECT * FROM `admin` WHERE admin-username='$username' and admin-password='$password' ";
  33. $result = mysql_query($query) or die(mysql_error());
  34. $rows = mysql_num_rows($result);
  35. if($rows==1){
  36. $_SESSION['admin-username'] = $username;
  37. header("Location: admin.php");
  38. }else{
  39. echo "<div class='form'><h3>Username/password is incorrect.</h3></div>";
  40. }
  41. }else
  42. ?>
  43. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement