开发者

PHP form submit button in $_GET

I have a form that submits a search for blogs on my site via GET.

The form works fine, but when submitted, the url on the following page reads ("Find it" is the value of my submit button):

www.example.com/search.php?sub_q=Find+it%21&q=tennis

This just isn't an aesthetically pleasing url. Is there 开发者_运维百科a simple way to exclude the submit button from the URL? I would like the url to look like:

www.example.com/search.php?q=tennis

The search.php doesn't require $_GET['sub_q'] to operate, btw.


Try not naming your button (remove the name attribute) - it shouldn't be submitted if it doesn't have n name


See my answer here: SEO/PHP: How to Convert Form-Submit URL (Get-Method) without Javascript SEO-Friendly?

Basically: redirect to an easier-to-spell-out-URI

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜