【发布时间】:2014-10-06 08:29:01
【问题描述】:
我在自己的网站上构建了自己的搜索引擎。
当我单击提交(作为搜索按钮)时,我希望在 URL 处搜索的输出是:
http://inindonesia.org/marketplace/tags/oleh-oleh-khas-medan
但是,当我点击提交(搜索按钮)时,输出是:
http://inindonesia.org/marketplace/tags/?search=oleh+oleh+khas+medan&hidden=oleh-oleh-khas-medan&Submit=Cari+Produk
我的代码是:
<form autocomplete="off" action="/marketplace/tags/(i want this get parameter from the value input id "hidden", example : oleh-oleh-khas-medan)" method="GET">
<table border="0" border="0" cellpadding="2px" cellspacing="2px" width="100%" bgcolor="">
<tr>
<td style="font-size:12px; text-align:left;" width="80%">
<input id="search" name="search" type="text"/><input id="hidden" name="hidden" type="hidden"/>
</td>
<td style="font-size:12px; text-align:right;" width="20%">
<input id="searchsubmit" name="Submit" value="Cari Produk" type="submit">
仅供参考:我在我的网站上使用 Wordpress。
有什么想法可以改变我想要的 url 参数吗?
谢谢
【问题讨论】:
-
要获得准确描述的行为,您需要将方法更改为
POST,添加一个onsubmit处理程序,将input的值附加到actionurl,然后重新- 提交表单数据(或在 onsubmit 事件中使用window.location.href = http://inindonesia.org/marketplace/tags/ + input value和return false;。
标签: php mysql wordpress search-engine url-parameters