带有撇号的php参数 [英] php parameter with apostrophes

查看:49
本文介绍了带有撇号的php参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带撇号的字符串参数,我需要将其传递给另一个php页面. 我的代码是:

I have string parameter with apostrophes that I need to pass it to another php page. My code is:

echo '<form name="submitForm2" action="creatDocument.php?$formulation='.$formulation.'" method="POST">
         <input type="submit" value="pass"/>
         </form>';

$fomulation参数包含带有来自用户的希伯来字符的字符串. 如果$fomulation = אבג"דה

The $fomulation parameter contain the string with hebrew characters that came from user. if $fomulation = אבג"דה

creatDocument.php仅收到$fomulation = אבג. 我该如何解决?

creatDocument.php received just $fomulation = אבג . How can I fix it?

推荐答案

正在发生的事情是URL解析器使用单引号引起了中断.检查URLEncode方法,以对查询字符串参数进行编码.

What's happening is that the URL parser is breaking on the single quotes. Check out the URLEncode method, to encode your query string parameters.

http://us3.php.net/urlencode

这篇关于带有撇号的php参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆