Thanks all - CH
On Jan 17, 2005, at 8:35 AM, Henrik Hornemann wrote:
Hi,
} elseif ($_POST['route_photo'] = $_POST['oldimage']) Should probably be } elseif ($_POST['route_photo'] == $_POST['oldimage'])
Regards Henrik Hornemann
-----Oprindelig meddelelse----- Fra: Craig Hoffman [mailto:[EMAIL PROTECTED] Sendt: 17. januar 2005 15:22 Til: [email protected] Emne: [PHP-DB] Assistance with if..elseif statement
I have this block of code which checks to see if an image has been uploaded from an update form. Everything in the form works, except I can not get the the elseif statements to behave properly. See the comments below for explanation. Any help would be appreciated.
$route_photo = $_FILES['image']['name'];
// if no new image and no existing image put NULL in the DB if(empty($_FILES['image']['name']) && ($_POST['oldimage']) == '') { $route_photo = 'NULL'; echo ("No image supplied.");
// if new image put the new image name in the DB
} elseif ($_POST['route_photo'] || $_FILES['image']['name']) {
$route_photo = $_POST['route_photo'];
echo ("The image has been replaced with
$route_photo.");
// If no new image update, use the old image } elseif ($_POST['route_photo'] = $_POST['oldimage']) { $route_photo = $_POST['oldimage']; echo("No new image supplied"); }
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
