moved NewItem Button to the MenuBar
This commit is contained in:
@@ -16,9 +16,10 @@ $ItemImage = $_POST['ItemImage'];
|
||||
$headers = get_headers($ItemImage, 1);
|
||||
|
||||
if (strpos($headers['Content-Type'], 'image/') !== false) {
|
||||
$imageLocalLink = 'data/images/' . uniqid() . '.' . pathinfo($ItemImage, PATHINFO_EXTENSION);
|
||||
$strippedimagepath = strtok($ItemImage, '?');
|
||||
$imageLocalLink = 'data/images/' . uniqid() . '.' . pathinfo($strippedimagepath, PATHINFO_EXTENSION);
|
||||
echo "ImageLink: " . $imageLocalLink;
|
||||
file_put_contents($imageLocalLink, fopen($ItemImage, 'r'));
|
||||
file_put_contents($imageLocalLink, fopen($strippedimagepath, 'r'));
|
||||
} else {
|
||||
echo "Link is Not an Image";
|
||||
}
|
||||
@@ -40,7 +41,7 @@ if (false === $stmt) {
|
||||
die('prepare() failed: ' . htmlspecialchars($mysqli->error));
|
||||
}
|
||||
|
||||
$rc = $stmt->bind_param('ssssi', $ItemTitle, $ItemDescription, $imageLocalLink, $ItemImage, $ItemPriceCents);
|
||||
$rc = $stmt->bind_param('ssssi', $ItemTitle, $ItemDescription, $ItemLink, $imageLocalLink, $ItemPriceCents);
|
||||
if (false === $rc) {
|
||||
die('bind_param() failed: ' . htmlspecialchars($stmt->error));
|
||||
}
|
||||
|
Reference in New Issue
Block a user