时间:2021-07-01 10:21:17 帮助过:6人阅读
- <h2></h2>
- <!-- enctype 属性可能的值:
- application/x-www-form-urlencoded
- multipart/form-data
- text/plain
- 规定在发送表单数据之前如何对其进行编码。
- target
- 规定在何处打开 action URL。(这边是iframe里)
- onsubmit 点击运行js的方法通过才到`action
- 文件上传说没上传 enctype没写-->
php部分 error为0就代表文件上传成功 在之前写的h1标签里出现信息
- <!--?php
- if(empty($_FILES)){
- exit('no file');
- }
- $error = $_FILES['pic']['error'] == 0 ? '上传成功':'上传失败';
- echo "";
- ?-->
以上就介绍了ajax--iframe模拟ajax文件上传效果,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。