hi experts,
i am referring to [URL=http://www.webdeveloper.com/forum/showthread.php?t=96532]this thread[B]bokeh[B]“How to: Upload images using PHP”
i want to achieve a solution where one can add a news item to a mysql db and [B]optionally
so i modified the [B]upload.form.php
next i edited [B]upload.processor.php
that works perfectly as long as there is a picture attached and it doesn´t exceed the $max_file_size.
since i want to make the image upload optional i tried some [B]if-else statements in upload.processor.php
no surprise to me that none of my attempts worked so i´m kindly asking for your help to achieve something like this:
[code=php]if (there was a picture selected in upload.form.php) {
// …do what bokeh´s original script does (including error checking) + store info in db…
} else {
// …only store the values of the fields “headline” and “text” into the db and ignore that an image is missing…
my problem is to find the right [B]if-statement[B]if (strlen($_FILES[$fieldname][‘tmp_name’]) > 1)
any ideas?
thanks in advance,
jogol