image path / display problem

hi there,
I try to display images which have been uploaded as part of a news entry from users to my server, while the name has been stored in a mysql table.
now the tricky thing is that some times there are no images in this messages and sometimes there are.
I made it so far that the image upload works and also the display of them, only if there is a message containing no picture, I have to deal with a empty image tag, which shows a “missing image” symbol.
to solve this problem I thought about to set the image path to a default 1x1.gif, always when the upload is empty.
to do so i have tried this script:

// set image path to 1x1.gif if no image is uploaded
if($_FILES =“0”)
{
$filename = “images/1x1.gif”;
}else{
$filename = “images/” . time() .
$_FILES[‘uploadedfile’][‘name’];
}

but it doesent work, somehow my syntax seems to be wrong ?
could be a diferent solution as well, as long as I get rid of the missing image symbols :-)
thanks a lot for your help !

Sponsor our Newsletter | Privacy Policy | Terms of Service