dboy1612 Posted April 10, 2011 Share Posted April 10, 2011 Hi everyone! So, this is probably one of the most simplest things to all you pros out there, but unfortunately I think I'm using the wrong words in Google as I can't seem to remember what they're called (Yeah I'm not that brilliant.) Anyway, a quick one for you guys. What I'm looking for is a simple script or method to send a Search Query to end with a URL. For example. Lets say I'm on http://mysite.com/index.php, and on that page is a search box. Now, lets say I search the word "Pizza" in that search box. I want the end result to be "http://myspace.com/search.php?s=pizza" I already have the script I'd like to use to read that value, I just simply don't know how to put that value there in the first. Yes, I know, noobish question, I'm sorry. XD Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/233308-search-query-to-url/ Share on other sites More sharing options...
dcro2 Posted April 11, 2011 Share Posted April 11, 2011 It's alright. Sometimes the simplest things are the hardest to find haha. All you have to do is make your form like this: <form action="search.php" method="get"> <input type="text" name="s"> </form> The important part is setting method="get". Quote Link to comment https://forums.phpfreaks.com/topic/233308-search-query-to-url/#findComment-1199840 Share on other sites More sharing options...
spiderwell Posted April 11, 2011 Share Posted April 11, 2011 just use a form with a method of get instead of post edit: what he said lol Quote Link to comment https://forums.phpfreaks.com/topic/233308-search-query-to-url/#findComment-1199841 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.