![]() |
Struggling with image uploads
Hello
I am really just getting to grips with php and mysql, and have a problem with a html form and php script which, apart from other details, uploads an image if required. I have got that working to my satisfaction. I also want to give the capability of editing the information. But if there is no change to the image, I want to leave that field blank. Trouble is, either an invalid file is reported, or it removes the image filename from the database when that field is left blank. I have found that if I load the file again, I can cause the script to ignore it if it already exists, so I could leave it at that, but I would rather leave the field blank. I have spent ages on trying to figure this out. I have totally mucked up my php script that uploads the file, and I am completely confused. I have found (through Google) that the $_FILES array always returns TRUE, so how is it possible to find out if an image has been specified (or more importantly, if it has not!). Any help with this would be greatly appreciated. Cliff |
Without seeing your code there is nothing we can to do help you besides refer you to Google.
|
Quote:
I have included the offending part of my script. It is an index.php file, the first once downloaded when the administrator logs in. It is a controller file: the 'add artist' and 'delete artist' are working, so I have not shown them. I have included the entire part of the script concerned with editing artists, although it is the 'Process editform' that I am having trouble with. PHP Code:
Cliff |
Hi
Probably not the best method (I am still trying to learn), but I have solved my problem: PHP Code:
Cliff |
| All times are GMT. The time now is 08:03 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0