Initial commit from online.
This commit is contained in:
39
admin/inhalte/fotos/bilder/del.php
Normal file
39
admin/inhalte/fotos/bilder/del.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_POST['Speichern'])) {
|
||||
echo "<p>Dieses Bild löschen?</p>\n";
|
||||
$file = "../img/umgebung/bilder/".$_POST['Titel'].".jpg";
|
||||
echo "<img src=\"$file\"><br />\n";
|
||||
$sql1 = 'SELECT * FROM bilder WHERE ID = "'.$_POST['Titel'].'"';
|
||||
$result1 = $db->query($sql1);
|
||||
$nt1 = $result1->fetch_assoc();
|
||||
echo "<h3>$nt1[Head]</h3>";
|
||||
?>
|
||||
<form action="index.php?section=fotos&t=bilder" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="del" value="speichern" />
|
||||
<input type="hidden" name="id" value="<?php echo $_POST['Titel']; ?>" />
|
||||
<input type="hidden" name="file" value="<?php echo $file; ?>" />
|
||||
<br />
|
||||
<input type="submit" name="Speichern" value="L<>schen" />
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$sql2 = 'DELETE FROM bilder WHERE ID = "'.$_POST['id'].'"';
|
||||
$result2 = $db->query($sql2);
|
||||
if ($result2) {
|
||||
echo "<p>Datenbankeintrag gelöscht</p>\n";
|
||||
if (unlink($_POST['file'])) {
|
||||
echo "<p>Bild wurde gelöscht</p>\n";
|
||||
}
|
||||
else {
|
||||
echo "<p>Fehler beim Löschen des Bildes</p>\n";
|
||||
}
|
||||
} else {
|
||||
echo "Fehler beim L<>schen";
|
||||
}
|
||||
echo '<a href="index.php?section=fotos&t=bilder">Zur<75>ck zur <20>bersicht</a>';
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user