if($_FILES['files']['name']!=“”) r

2019-08-11 03:12发布

Not having any luck with my other thread with specific code so if I can I'd like to ask how people would go about getting this to work.

I have an page where my client edits details of a property displayed on a property list, say they edit text and don't add any images to this property.

HTML form works fine, I'm just looking at the php.

Example:

If files selected then run this script as an include
If no files selected then exit

Something like this...

if($_FILES['files']['name']!="")
 {
 Do this
 }
  else
{
exit();
}

I'm going mental trying to figure this out so any help or suggestions would be great. I have tried a few variations and variations on top of those variations and nothing seems to work so far.

Cheers

1条回答
成全新的幸福
2楼-- · 2019-08-11 03:35

Use isset() orempty() constructs. (For more information read PHP doc)

if(!empty($_FILES['files']['name']))
 {
  //
 }
查看更多
登录 后发表回答