【问题标题】:I want to use search bar without using submit我想使用搜索栏而不使用提交
【发布时间】:2015-03-19 11:12:50
【问题描述】:

当我输入搜索查询时,我会得到以下网址

http://localhost/bp/contactus.php?search=bvlfnfdl&submit=Submit

当我想要它时

http://localhost/bp/contactus.php?search=bvlfnfdl

如何做到这一点,请帮助

【问题讨论】:

  • 触发更改输入
  • 删除提交按钮的name 属性。

标签: php html get


【解决方案1】:

删除提交按钮上的“名称”。

<form action="search.php" method="get">
   <input type="text" name="search" />
   <input type="submit" value="search" />
</form>

然后在您的 PHP 中,您只需访问 $_GET['search'] 即可获取搜索到的数据。

【讨论】:

  • 我知道,但我想修改链接
  • 这是什么意思?这将删除 &amp;submit=submit 部分
猜你喜欢
  • 1970-01-01
  • 2019-03-01
  • 2014-09-18
  • 2014-06-29
  • 1970-01-01
  • 2013-12-13
  • 2021-11-09
  • 2016-03-31
  • 1970-01-01
相关资源
最近更新 更多