Advertisement
Guest User

Untitled

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