关于将表单上传到服务器

怎样将表单上传到服务器

<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
//此处为input表单
</form>
//method为表单提交的方法,action为表单提交的服务器地址(此处为本文件,亦可具体到某一文件eg:upload_file.php form_action.asp )
enctype:表单提交到服务器之前要进行编码
    application/x-www-form-urlencoded 发送前编码所有字符(默认)
    multipart/form-data 二进制数据,不对字符编码,在使用包含文件上传控件的表单时,必须使用该值。
    text/plain      空格转化为“+”号,但不对特殊字符编码。
You can change the world with your heart,even a lot of changes sometimes unless you won't geiv up....
原文地址:https://www.cnblogs.com/xiongwei2017/p/6585010.html