【问题标题】:How to remove special characters in URL during Form Submission如何在表单提交期间删除 URL 中的特殊字符
【发布时间】:2015-05-27 16:13:00
【问题描述】:

我正在尝试在 PHP 中提交表单期间删除特殊字符。每次我想提交数据时:

<form action="?" method="get">
<input type="text" name="str" value="I want to remove this" />
</form>

浏览器中的输出如下所示

http://localhost/?str=I+want+to+remove+this 

有没有办法在提交之前或提交期间去掉那些“+”?

我的预期结果是

http://localhost/?str=I want to remove this

感谢您的帮助...

【问题讨论】:

    标签: php forms submission


    【解决方案1】:

    在服务器端的url中不能有空格

    str=I+want+to+remove+this 
    

    将被读作

    str=I want to remove this
    

    仅限。所以我认为你真的不需要担心这种编码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-29
      • 2011-11-20
      相关资源
      最近更新 更多