我有带撇号的字符串参数,我需要将其传递到另一个 php 页面。
我的代码是:
echo '<form name="submitForm2" action="creatDocument.php?$formulation='.$formulation.'" method="POST">
<input type="submit" value="pass"/>
</form>';
The $fomulation
参数包含来自用户的带有希伯来字符的字符串。
如果$fomulation = אבג"דה
creatDocument.php
刚刚收到$fomulation = אבג
。
我该如何修复它?
发生的情况是 URL 解析器在单引号上被破坏。查看URLEncode
方法,对查询字符串参数进行编码。
https://www.php.net/urlencode
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)