Bugfix in deleting wishes
This commit is contained in:
@@ -25,9 +25,9 @@ $headers = array_change_key_case(get_headers($ItemImage, 1), CASE_LOWER);
|
||||
|
||||
if (strpos($headers['content-type'], 'image/') !== false) {
|
||||
$strippedimagepath = strtok($ItemImage, '?');
|
||||
$imageLocalLink = $imagedir . '/' . uniqid() . '.' . pathinfo($strippedimagepath, PATHINFO_EXTENSION);
|
||||
$imageLocalLink = uniqid() . '.' . pathinfo($strippedimagepath, PATHINFO_EXTENSION);
|
||||
echo "ImageLink: " . $imageLocalLink;
|
||||
file_put_contents($imageLocalLink, fopen($strippedimagepath, 'r'));
|
||||
file_put_contents($imagedir . '/' . $imageLocalLink, fopen($strippedimagepath, 'r'));
|
||||
} else {
|
||||
echo "Link is Not an Image";
|
||||
}
|
||||
|
@@ -146,7 +146,7 @@ if (isset($_POST['delete']) && $loggedin == true) {
|
||||
|
||||
if ($result !== false && $result->num_rows > 0) {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
unlink($row['image']);
|
||||
unlink($imagedir . '/' . $row['image']);
|
||||
$WhishTitle = $row['title'];
|
||||
}
|
||||
}
|
||||
@@ -419,7 +419,7 @@ if (isset($_POST['delete']) && $loggedin == true) {
|
||||
<?php
|
||||
if ($loggedin == true) {
|
||||
echo ('
|
||||
$(\'#deleteModal\').on(\'show.bs.modal\', function(event) \{
|
||||
$(\'#deleteModal\').on(\'show.bs.modal\', function(event) {
|
||||
var resTr = $(event.relatedTarget)
|
||||
var whishcard = resTr.parents().closest(\'.card\');
|
||||
var whishtitle = whishcard.find(\'.card-title\').text();
|
||||
|
Reference in New Issue
Block a user