2015-03-19 21 views
-4

當我鍵入搜索查詢,我得到以下網址我想使用搜索欄,而不使用提交

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

,而我想把它當作

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

如何做到這一點好心幫

+0

tirgger on change input – 2015-03-19 11:14:10

+1

刪除提交按鈕的'name'屬性。 – jeroen 2015-03-19 11:15:53

回答

0

刪除提交按鈕上的'姓名'。

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

然後在您的PHP中,您可以訪問$_GET['search']來抓取搜索到的數據。

+0

我知道,但我想修改鏈接 – 2015-03-19 15:12:32

+0

這是什麼意思?這將刪除'&submit = submit'部分 – Jarkerwastaken 2015-03-19 15:17:01