class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
If there is no image added in the form, I'd like to still do some actions, but ignore the upload alltogether. I've been battling away but to no avail. Clues?Reply
if no image is posted { insert query with NO image } else { upload image insert query with image }$handle = new upload($_FILES['image_field']); if ($handle->uploaded) { if ($handle->file_is_image) { // file is an image $handle->image_resize = true; $handle->image_x = 200; $handle->process('Test'); if ($handle->processed) { echo 'file uploaded'; $handle->clean(); } else { echo 'error : ' . $handle->error; } } else { // file is not an image $handle->clean(); } }