Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/242.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在表单中使用urlencode()_Php_Html_Urlencode_Urldecode - Fatal编程技术网

Php 在表单中使用urlencode()

Php 在表单中使用urlencode(),php,html,urlencode,urldecode,Php,Html,Urlencode,Urldecode,我需要发送特殊字符(如波兰字符)使用的形式。我发现我需要使用urlencode和urdecode。发送表单时如何使用它 形式代码是 <form id="form1" action="add.php" method="POST" accept-charset="utf-8"> Description: <input type=text name="title" maxlenght=150/><br/> Link: <input type=text

我需要发送特殊字符(如波兰字符)使用的形式。我发现我需要使用urlencode和urdecode。发送表单时如何使用它

形式代码是

<form id="form1" action="add.php" method="POST" accept-charset="utf-8">
  Description: <input type=text name="title" maxlenght=150/><br/>
  Link: <input type=text name="link"/><br/>
<input type=submit value="Send"/>

说明:
链接:

您根本不需要使用它们

提交表单将导致浏览器自动编码字符

由于您使用的是PHP,
$\u POST
将自动使用解码字符填充



如果存在字符编码问题,且字符编码或解码不正确,请参阅。

Sidenote:Typo“maxlenght”。将“h”切换为“t”;)请@Fred ii-谢谢。我没看到,不客气,cheers@Quentin谢谢你的建议。我是初学者,我会读的。谢谢。我的问题是使用mysqli。我用PDO试过了,效果很好。