Advertisement
Guest User

Untitled

a guest
May 29th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.58 KB | None | 0 0
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. #customers
  5. {
  6. font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
  7. width:100%;
  8. border-collapse:collapse;
  9. }
  10. #customers td, #customers th
  11. {
  12. font-size:1em;
  13. border:1px solid #98bf21;
  14. padding:3px 7px 2px 7px;
  15. }
  16. #customers th
  17. {
  18. font-size:1.1em;
  19. text-align:left;
  20. padding-top:5px;
  21. padding-bottom:4px;
  22. background-color:#A7C942;
  23. color:#ffffff;
  24. }
  25. #customers tr.alt td
  26. {
  27. color:#000000;
  28. background-color:#EAF2D3;
  29. }
  30. </style>
  31. <title>DU Server - Banlist</title>
  32. </head>
  33. <body bgcolor="#E8E8E8">
  34. <center><h1>BANLIST</h1></center>
  35. <?php
  36. error_reporting(E_ALL);
  37. $username = "nou";
  38. $password = "nomeu";
  39. $banfile = "/home/srv2300/database.sqlite"
  40.  
  41. if (isset($_POST['submit'])) {
  42. if ($_POST['username'] == $username) {
  43. if ($_POST['password'] == $password) {
  44. $database = new PDO("sqlite:".$banfile);
  45. $sql = "SELECT * FROM Bans";
  46. echo "<table id="customers"><tr><td>Name</td><td>IP</td><td>Reason</td><td>Admin</td></tr>
  47. ";
  48. foreach ($database->query($sql) as $row)
  49. {
  50. echo "<tr><td>".$row['Name']."</td><td>".$row['IP']."</td><td>".$row['Reason']."</td><td>".$row['BannedBy']."</tr>";
  51. }
  52. echo "</table>";
  53. }
  54. else echo "Wrong password.";
  55. }
  56. else echo "Wrong username.";
  57. }
  58. else {
  59. ?>
  60. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
  61. <table border="0">
  62. <tr><td>Username:</td><td><input type="text" name="username"/></td></tr>
  63. <tr><td>Password:</td><td><input type="password" name="password"/></td></tr>
  64. <tr><td><input type="submit" name="submit" value="Login"/></td></tr>
  65. </table>
  66. </form>
  67. <?php
  68. }
  69. ?>
  70. </body>
  71. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement