我的上传文件中有此错误.语法是正确的,问题出在哪里?
错误:
is_uploaded_file()期望参数1为字符串,在第34行的C:\ Program Files\EasyPHP-5.3.5.0\www\bena_website\admin\variables\upload_img.php中给出的数组
<h3>Please Choose a File and click Submit</h3>
<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
<input name="userfile[]" type="file" />
<input type="submit" value="Submit" />
</form>
<?php
// check if a file was submitted
if(!isset($_FILES['userfile'])) {
echo '<p>Please select a file</p>';
}
else
{
print_r( $_FILES );
try {
upload();
// give praise and thanks to the php gods
echo '<p>Thank you for submitting</p>';
}
catch(Exception $e) {
echo $e->getMessage();
echo 'Sorry, could …Run Code Online (Sandbox Code Playgroud)