我已经拥有了GET方法?在我的查询字符串中

kir*_*423 2 php forms get

这似乎是一个简单的回答问题,但我无法弄清楚如何做到这一点,或者它是否可能.

我正在建立一个搜索栏,以便用户可以在网站上搜索优惠.它使用该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>
Run Code Online (Sandbox Code Playgroud)

Mat*_*att 6

试试这个:

<form method='get' action='index.php'>
    <input type='hidden' name='rs' value='offers' />
    .
    .
    .
</form>
Run Code Online (Sandbox Code Playgroud)