Home  >  Article  >  Backend Development  >  php 图片下传有关问题,请高手指教

php 图片下传有关问题,请高手指教

WBOY
WBOYOriginal
2016-06-13 13:08:09856browse

php 图片上传问题,请高手指教
我使用了一个file控件来获取上传图片的路径,我一共要上传2张图片,第一张可以上传,但是第二张上传不了,这是为什么,以下是代码

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
<tr>
    <td>picture</td>
    <td><input name="file" type="file" id="Browse"></td>
  </tr>
  <tr>
    <td>face</td>
    <td><input name="face" type="file" id="Browse2"></td>
  </tr>

$pic = "http://www.surakichina.com/upload/" . $_FILES["file"]["name"];
  $face = "http://www.surakichina.com/upload/" . $_FILES["face"]["name"];



我是菜鸟中的菜鸟,所以请各路高手讲仔细点,谢谢了

------解决方案--------------------
是这样的
------解决方案--------------------
$_FILES["file"]["name"][0];
$_FILES["file"]["name"][1];

------解决方案--------------------
你应该把你的表单代码贴出。
两个input控件在一个表单里上传不会出现你的问题。
------解决方案--------------------
是只有第一张不?你得用循环吧,一下提交两张上去啊,得一张一张处理的
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn