English 中文(简体)
是否试图补充说明何时张贴表格,用户是否包括档案?
原标题:im trying to add an if else statement for when the form is posted and wether or not the user include files or not?

我怎么说? 用户可以选择增加图像。 如果添加图象,即希望吗? 如果图象是这样的话,如果是真的,那么我就希望其他图象能够运行,取决于是否添加了两个不同的图象。

if (isset($_POST[ formsubmitted ])) { 

if (isset($_POST[ name ])){  }else{  }

if (isset($_POST[ state ])){  }else{  }

if (isset($_FILES[ images ][ name ])) { echo  images ; exit;} else {echo  no images ; exit;}


} #end main form submitted

如果(发行量_FILES[图像][名称])做主工作,即使现在没有提交图像,也仍然有提交图像的内容。

The html file areas are:

<form>
<input type= file  name= images[]  id=  >
<input type= file  name= images[]  id=  >
<input type= file  name= images[]  id=  >
<input type = "submit">    
</form>
最佳回答

你们应努力做到这一点。

Submit.php

<pre>
<?php 
// those index are empty the array filter remove this 

echo "without filter"."<br>";
print_r($_FILES[ images ][ name ]);

echo "filter"."<br>";
$usersFileUpload = array_filter($_FILES[ images ][ name ]);
print_r($usersFileUpload);

$usersFileUploadCount = count($usersFileUpload);

for($i=0;$i<=$usersFileUploadCount;$i++){
    echo $usersFileUpload[$i]."<br>";

    // insert Table     
}
?>

HtmlForm.php

<form action="submit.php" method="post" enctype="multipart/form-data" name="images">
<input type= file  name= images[]  id=  ><br />
<input type= file  name= images[]  id=  ><br />
<input type= file  name= images[]  id=  >
<input name="" type="submit" />
</form>

见核查图像1

“entergraph

见核查图像2

“entergraph

问题回答

不能理解,我认为你正在努力这样做。

if (isset($_FILES[ name ]) && isset($_FILES[ images ]))

查阅美元 FILES[图像][误差][美元]等于4。 如果我正确回顾,那就表明了上载的错误。

很明显,每次篡改你的图像,基本上用上载体的关键取代x美元。

空阵仍是一个阵列。

见:。 https://www.php.net/manual/en/features.file-upload.errors.php

另外,。 https://www.php.net/manual/en/features.file-upload.php <- 手册。 Handy!

引言

if($_FILES[ your-name-file ][ error ] == 4) {
            //process your error
    }

它为我工作!





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签