时间:2021-07-01 10:21:17 帮助过:5人阅读
- >
- <htmlxmlnshtmlxmlns="http://www.w3.org/1999/xhtml">
- <head>
- <metahttp-equivmetahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
- <title>无标题文档< SPAN>title>
- < SPAN>head>
- <body>
- <formenctypeformenctype="multipart/form-data"action="upload.php"method="post">
- <inputtypeinputtype="hidden"name="max_file_size"value=300000>
- <inputnameinputname="userfile"type="file">
- <inputtypeinputtype="submit">
- < SPAN>form>
- < SPAN>body>
- < SPAN>html>
- //upload.php
- php
- $uploaddir="c:\";
- $uploadfile=$uploaddir.$_FILES['userfile']['name'];
- print"<pre>";
- if(move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile))
- {
- print("上传成功!");
- print_r($_FILES);
- }
- else
- {
- print("上传失败!");
- print_r($_FILES);
- }
- print"< SPAN>pre>";
- ?>
以上就是详细的PHP上传文件代码,希望对大家有帮助。
http://www.bkjia.com/PHPjc/446553.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/446553.htmlTechArticle学习PHP时,你可能会遇到PHP上传文件问题,这里将介绍详细的PHP上传文件代码解决这个问题,在这里拿出来和大家分享一下。php的语法非常...