Thanks for any help anyone can offer with this!
Here is the basic upload code we have for one image:
[php]<?php
if (isset($_POST[‘submitted’])) {
// Check for an image.
if (is_uploaded_file ($_FILES[‘image’][‘tmp_name’])) {
if (move_uploaded_file($_FILES[‘image’][‘tmp_name’], “uploads/{$_FILES[‘image’][‘name’]}”)) { // Move the file over.
echo ‘
The file has been uploaded!
’;$i = $_FILES[‘image’][‘name’];
} else {
echo ‘
The file could not be moved.
’;$i = FALSE;
}}
if ($_POST[‘existing’]) {
$exg = stripslashes($_POST[‘existing’]);
}
else { // No name value.
$exg = FALSE;
echo ‘
Please enter the gallery’s name!
’;}
if ($exg && $i) { // If everything’s OK.
// Add the print to the database.
$query = “INSERT INTO prints (gallery_name, image_name) VALUES (’$exg’, ‘$i’)”;
if ($result = mysql_query ($query)) { // Worked.
echo ‘
The print has been added.
’;}} else { // If the query did not run OK.
echo ‘
Your submission could not be processed due to a system error.
’;}}
?>[/php]
I need it to perform the same functions that it does now (add the image name and gallery name to the database). The only issue is that I need to upload zip folders, unzip them, and have each image added to the database in the same way. Any ideas? Thanks.