View Single Post
  #1 (permalink)  
Old 04-23-2008, 04:29 PM
norbie norbie is offline
Newbie
 
Join Date: Dec 2006
Posts: 5
Rep Power: 0
norbie is on a distinguished road
Default Help with image upload script - need to make an if null statement

Hi guys,

I made/used an image uploader script today.

This is how the code works now after POSTing the details with a form.

PHP Code:
if (isset($_FILES['new_image'])){

// do image stuff

} else {

// don't do image stuff


Basically the image script does work but if the user doesn't enter anything into the image box, the rest of the form functions will work (entering info into a database) but it has messy errors on the page.

How can I create some kind of if statement that says "if they havent entered anything into the image field then dont do stuff" ?

I tried echoing $_FILES['new_image'] but it comes back as "array". I have not used $_FILES before so do not understand this.

Thanks.
Reply With Quote

Sponsored Links