Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- $username = "nou";
- $password = "nomeu";
- $banfile = "/home/srv2300/database.sqlite"
- if (isset($_POST['submit'])) {
- if ($_POST['username'] == $username) {
- if ($_POST['password'] == $password) {
- $database = new PDO("sqlite:".$banfile);
- $sql = "SELECT * FROM Bans";
- echo "<table id="customers"><tr><td>Name</td><td>IP</td><td>Reason</td><td>Admin</td></tr>
- ";
- foreach ($database->query($sql) as $row)
- {
- echo "<tr><td>".$row['Name']."</td><td>".$row['IP']."</td><td>".$row['Reason']."</td><td>".$row['BannedBy']."</tr>";
- }
- echo "</table>";
- }
- else echo "Wrong password.";
- }
- else echo "Wrong username.";
- }
- else {
- ?>
- <head>
- <style type="text/css">
- #customers
- {
- font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
- width:100%;
- border-collapse:collapse;
- }
- #customers td, #customers th
- {
- font-size:1em;
- border:1px solid #98bf21;
- padding:3px 7px 2px 7px;
- }
- #customers th
- {
- font-size:1.1em;
- text-align:left;
- padding-top:5px;
- padding-bottom:4px;
- background-color:#A7C942;
- color:#ffffff;
- }
- #customers tr.alt td
- {
- color:#000000;
- background-color:#EAF2D3;
- }
- </style>
- </head>
- <title>DU Server - Banlist</title>
- <body bgcolor="#E8E8E8"></body>
- <center>
- <h1>BANLIST</h1>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
- <table border="0">
- <tr><td>Username:</td><td><input type="text" name="username"/></td></tr>
- <tr><td>Password:</td><td><input type="password" name="password"/></td></tr>
- <tr><td><input type="submit" name="submit" value="Login"/></td></tr>
- </table>
- </form>
- </center>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement