php做文件上传提示move_uploaded_file函数未定义
我是菜鸟,刚开始自学php,做文件上传时提示move_uploaded_file函数未定义,move_uploaded_file函数不是php内置函数吗?我看了网上很多教...
我是菜鸟,刚开始自学php,做文件上传时提示move_uploaded_file函数未定义,move_uploaded_file函数不是php内置函数吗?我看了网上很多教程,都是直接调用的,没有重新定义啊。我查到move_uploaded_file函数是filesystem下的,但在php.ini里面没有找到这个啊,需要特殊配置吗?
html代码:
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
上传:<input type="file" name="myfile" id="myfile" />
<input type="submit" name="submit" value="上传" />
</form>
提交代码:
$uploaddir = '/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if(!empty($_FILES) && $_FILES['myfile']['error']==0){
mover_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);
} 展开
html代码:
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
上传:<input type="file" name="myfile" id="myfile" />
<input type="submit" name="submit" value="上传" />
</form>
提交代码:
$uploaddir = '/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if(!empty($_FILES) && $_FILES['myfile']['error']==0){
mover_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询