Submitting search form but also having query string in PHP (and JS)
I have a page with a search form (with just one field) submitting to another page to perform a search and show results.
Often on other sites whenever I search for something in a form I see my search terms in a query string which is handy for bookmarking/sharing a link with someone.
eg-
http://grooveshark.com/#/search开发者_如何学编程?q=name+of+band
How is the query string made from a form submission?
Change your form to use the get method instead of post, or add the attribute below if it's not there already.
<form name="test" action="some/page.php" method="get">
The query string is constructed by the user agent by processing the form data. You can read more about it here.
精彩评论