在php中我有一个像这样的文件上传脚本
<form id="formID" method="post" action="'.$_SERVER['REQUEST_URI'].'" enctype="multipart/form-data">
<div>
<label>'.$this->l('Upload Your Custom Pin').'</label>
<input type="file" name="file" id="file" />
</div>
<div>
<label>'.$this->l('Upload Your Store Image').'</label>
<input type="file" name="store_image" id="store_image" />
</div>
<input type="submit" name="submit" value="submit" />
</form>
$image_name = time().$_FILES['file']['name'];
$store_image_name = time().$_FILES['store_image']['name'];
if(isset($_POST['submit'])) {
mysql_query('INSERT INTO `'._DB_PREFIX_.'databasename` (`id`, `custom_pin_name`,`store_image_name`) values ('', $custom_pin,$store_img_name) or die(mysql_error());
if(move_uploaded_file($_FILES['file']['tmp_name'], $tmpName.$image_name) && ($_FILES['store_image']['tmp_name'], $tmpName.$store_image) ) {
$this->_html .=$this->displayConfirmation($this->l('Settings updated successfully'));
} else {
$errors .= $this->displayError($this->l('You Have Some Errors'));
}
}
在这里你可以看到我正在上传两个文件并将它们移动到目录中。但是,当我这样做以移动上传文件时,它会显示错误,例如
Parse error: syntax error, unexpected ',' in line number 18(where I have used move_uploaded_file).
但是当我只使用这样一个文件时
if(isset($_POST['submit'])) {
mysql_query('INSERT INTO `'._DB_PREFIX_.'databasename` (`id`, `custom_pin_name`,`store_image_name`) values ('', $custom_pin,$store_img_name) or die(mysql_error());
if(move_uploaded_file($_FILES['file']['tmp_name'], $tmpName.$image_name) ) {
$this->_html .=$this->displayConfirmation($this->l('Settings updated successfully'));
} else {
$errors .= $this->displayError($this->l('You Have Some Errors'));
}
}
它做得很好。那么有人可以告诉我如何解决这个问题吗?