【问题标题】:Joomla form method post strips away diacriticsJoomla 表单方法帖子去掉了变音符号
【发布时间】:2013-01-18 17:41:25
【问题描述】:

我有一个带有表单的 Joomla 模块:

<form id="ContactForm"  action="<?php echo JRoute::_('index.php?option=com_k2&view=search&layout=search&Itemid=1303');?>" method="post">
<table>
<tr>
<td>
Vyhledat: <input type="text" name="searchKey" value="" style="width: 400px;"/>
</td>
<td>
<input type="submit" value="Vyhledat" /><br />

</td>
</tr>
</table>

</form>

我使用 POST 方法将数据发送到目的地。 我“抓住”他们:

 $foo = JRequest::getString('searchKey');

当我搜索没有变音符号的单词(adam、andy、任何东西)时,它的效果非常好。然而,它是一个捷克网站,它使用变音符号,所以当我尝试搜索 Jiří 时,字母 ř 和 í 被去掉,它只使用 JI。

我的问题是:为什么会这样以及如何解决这个问题?

【问题讨论】:

标签: php joomla joomla2.5


【解决方案1】:

Joomla 获取字符串方法会去除特殊字符

阅读这份 Joomla 官方文档

http://docs.joomla.org/Retrieving_and_Filtering_GET_and_POST_requests_with_JRequest::getVar

使用 JREQUEST_ALLOWRAW 将解决您的问题

【讨论】:

  • 笨笨笨笨的-> 我是因为我花了半天的时间来解决这个问题,.. 现在我知道如何完成这件事了。非常感谢!
猜你喜欢
  • 2015-07-19
  • 2016-10-20
  • 2015-04-30
  • 1970-01-01
  • 2011-03-30
  • 2018-02-28
  • 2023-03-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多