当我已经有一个?在我的查询字符串中 - php

这似乎是一个易于回答的问题,但我无法弄清楚该怎么做,甚至不可能。

我正在建立一个搜索栏,以便用户可以在网站上搜索优惠。它可以使用POST方法工作,但不会更新Querystring,我希望用户能够看到他们搜索的内容,因此我必须使用GET方法。

我的网址设置如下:

http://mysitename.com/index.php?rs=offers

?rs=offers定义在报价页面上。如果没有?rs=,它将注册为直接访问index.php文件,并给出错误。这就像一个反黑客的东西。

我想知道的是如何在GET之后启动?rs=offers方法,以便它读取如下内容:

http://mysitename.com/index.php?rs=offers&find=whatisearched

现在看起来像这样:

http://mysitename.com/index.php?find=whatisearched

这给出了我上面描述的错误。

这也是当前的表单布局,因此您可以查看其中是否存在我可能定义错误的内容。

<form method='get' action='index.php?rs=offers'>
    <table class='offers'>
<tr>
    <th>Search All Offers</th>
</tr>
<tr> 

    <td>

      <input type='text' name='find' maxlength='255' style='width:200px' value='' />

      <input type='submit' value='Search' />

    </td>

  </tr>

</table>
</form>

参考方案

尝试以下方法:

<form method='get' action='index.php'>
    <input type='hidden' name='rs' value='offers' />
    .
    .
    .
</form>

验证IBAN PHP - php

在设计新平台时,我们尝试集成IBAN编号。我们必须确保IBAN已经过验证,并且存储在数据库中的IBAN始终正确。那么验证数字的正确方法是什么? 参考方案 正如我在其他问题中解释的逻辑一样,我尝试自己创建一个函数。根据Wikipedia文章中解释的逻辑,在下面找到合适的功能。国家特定验证。它适合吗http://en.wikipedia.org/wiki/Int…

preg_replace排除<a href='''> </a> PHP - php

我正在使用preg_replace来替换带有href标签的文本中的关键字,我的正则表达式工作非常好,现在我的代码是:$newstring2 = preg_replace("/\p{L}*?".preg_quote($match[$i])."\p{L}*/ui", "<a href='"…

PHP PDO组按列名称查询结果 - php

以下PDO查询返回以下结果:$db = new PDO('....'); $sth = $db->prepare('SELECT ...'); 结果如下: name curso ABC stack CDE stack FGH stack IJK stack LMN overflow OPQ overflow RS…

php Singleton类实例将在多个会话中保留吗? - php

举一个简单的例子,如果我想计算一个不使用磁盘存储的脚本的命中次数,我可以使用静态类成员来执行此操作吗?用户1:<?php $test = Example::singleton(); $test->visits++; ?> 用户2:<?php $test = Example::singleton(); $test->visits+…

PHP:对数组排序 - php

请如何排序以下数组Array ( 'ben' => 1.0, 'ken' => 2.0, 'sam' => 1.5 ) 至Array ( 'ken' => 2.0, 'sam' => 1.5, 'ben' =&…