Home  >  Article  >  Backend Development  >  PHP模糊查询把搜索的关键词传递到url上的原理是怎样的?

PHP模糊查询把搜索的关键词传递到url上的原理是怎样的?

WBOY
WBOYOriginal
2016-07-06 13:52:04973browse

<code><form method="post" action="<%7Burl%20c='main'%20a='search'%7D>">
    <input type="text" name="kw" class="search_text fl" placeholder="">
    <input type="submit" class="search_btn fr" value="搜 索">
</form></code>

现在模糊查询后是这样localhost/main/search.html
想要实现这种效果localhost/main/search.html?kw="关键词"
kw这个值传到url的原理是怎样的

回复内容:

<code><form method="post" action="<%7Burl%20c='main'%20a='search'%7D>">
    <input type="text" name="kw" class="search_text fl" placeholder="">
    <input type="submit" class="search_btn fr" value="搜 索">
</form></code>

现在模糊查询后是这样localhost/main/search.html
想要实现这种效果localhost/main/search.html?kw="关键词"
kw这个值传到url的原理是怎样的

你把表单方法改成get,就有你要的效果了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn