表格搜索到网址

时间:2011-12-23 16:48:01

标签: php forms

我有以下代码:

<form action="search.php" method="get" name="searchprod" id="prodsearch">
<table border="0" cellpadding="0" cellspacing="0">
    <tbody><tr>
        <td><input name="q" type="text" id="searchbox"  value="Search" onfocus="this.value=''; this.style.color='#333333';" /></td>
        <td><input type="submit" value="Search" class="searchButton" /></td>
    </tr>
</tbody></table>
</form>    

当用户搜索我如何制作它所以它看起来像“Dvd-player.html”而不是“search.php?q = dvd + player”

我有.htaccess,但不确定如何在表单中进行。

1 个答案:

答案 0 :(得分:1)

您可以使用Javascript将表单操作更改为表单的onsubmit事件中的searchbox-value.html