Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (!isset($_SESSION["username"])) {
- echo "Bitte erst anmelden, <a href=\"" . include('../../itable/include/link-login-3.php') . "\">hier</a>.";
- exit();
- }
- include('../../include/db_config2.php');
- if (isset($_POST["id"]) AND !empty($_POST["id"])) {
- $delete = "DELETE FROM updates WHERE id=".$_POST["id"];
- $query = mysql_query($delete);
- if ($query == true) {
- echo "Erfolgreich gelöscht.";
- } else {
- echo "Fehler im System. Bitte versuche es später noch einmal...";
- }
- }
- ?>
- <html>
- <head>
- <title><?php include '../../include/title/name.php'; ?></title>
- <link rel='SHORTCUT ICON' href='../../img/itable.jpg'>
- </head>
- <body>
- <h1>Updates</h1>
- <hr />
- <table border="1">
- <tr>
- <h4><th>Startzeit:</th><th>Endzeit:</th><th>Text:</th><th>Dauer:</th><th>Ausgabe:</th><th>Löschen:</th></h4>
- </tr>
- <?php
- $abfrage = "SELECT id,time,endtime,text,dauer FROM updates ORDER BY time DESC";
- $ergebnis = mysql_query($abfrage);
- while($row = mysql_fetch_object($ergebnis)) {
- echo "<tr>";
- echo "<td>" . $row->time . "</td>";
- echo "<td>" . $row->endtime . "</td>";
- echo "<td>" . $row->text . "</td>";
- echo "<td>" . $row->dauer . "</td>";
- echo "<td></td>";
- echo "<td>";
- echo "<form action='' method='POST'>";
- echo "<input type='hidden' name='id' value='" . $row->id . "'/>";
- echo "<input type='submit' value='Benutzer löschen'/></form>";
- echo "</td>";
- echo "</tr>";
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement