This is a discussion on "Help With Search Box/form" within the Web Page Design section. This forum, and the thread "Help With Search Box/form are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Help With Search Box/form
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Help With Search Box/form
Hi i am trying to create a search box on a site which will take you to the following page when you click the submit button:
www.mysite.co.uk/shop/compareprices/searchterm.htm "searchterm" being the variable submitted in the search box At present i have the following search box/form: <form style="margin-bottom:0;" action="http://www.mysite.co.uk/shop/index.php" method="get"> <input name="ps" type="text" value="Enter Keywords" onfocus="if(this.value=='Enter Keywords'){this.value=''; this.style.color='#000000';}" size=18 /> <input type="hidden" name="sv" value="1" /> <input type="submit" class="srchsubmit" value="Go" /> </form> This takes you to: http://www.mysite.co.uk/shop/index.php?ps=searchterm&sv=1 I have already got the mod rewrite working all i need is a searchbox/form which will take you to www.mysite.co.uk/shop/compareprices/searchterm.htm when submitted. is it possible to do this? Any help appreciated. William |
|
|
|
||||
|
Re: Help With Search Box/form
why not just use the following in your search script (index.php?ps=searchterm&sv=1)
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: Help With Search Box/form
Not really what i am after alexgeek.
What i really need is the search form code as i what it use the same search/form on deferent sites. Maybe i wasnt to clear about what i need. I want the form action to take you to for example: www.mysite.co.uk/shop/compareprices/widget.htm (with "widget" being the term submited in the search form) So what i need is the code for the form which will do this. I probably confused things mentioning the mod rewrite, the search form is what i need to get working. William |
|
||||
|
Re: Help With Search Box/form
Modrewrite would work for this,
I am probably wrong, but you might have to do something like the following:
www.mysite.co.uk/shop/compareprices.php?search=searchterm Then you can use modrewrite to make this: www.mysite.co.uk/shop/compareprices/searchtem
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: Help With Search Box/form
Then why talk?
im sure someone will come to help you out. (karinne is homing in on our distress signal now) |
|
||||
|
Re: Help With Search Box/form
You could solve this with javascript. A script like this could do the trick:
I think a PHP / mySQL solution would be better for something like this, but good luck however you do it.....
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
|||
|
Re: Help With Search Box/form
Thanks c010depunkk, I just saw your post.
I came up with something similar myself
www.mysite.co.uk/compareprices/blue%20widget.htm I want to replace this space to get: www.mysite.co.uk/compareprices/blue-widget.htm Thanks William Last edited by William M; Oct 4th, 2007 at 15:45. |
|
||||
|
Re: Help With Search Box/form
Use the replace function.
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Form output using mysql, search people name in specific category | basketmen | PHP Forum | 1 | Mar 24th, 2008 06:31 |
| [SOLVED] Form Search | longstand | PHP Forum | 6 | Nov 20th, 2007 06:13 |
| Anyone have a working search form script? | daveg33 | PHP Forum | 12 | Sep 28th, 2007 23:54 |
| Search Analyst/Account Executive/SEO/PPC/CPC/Search Engine Optimisation/Pay per Click/London | Web JobBot | Job Opportunities | 0 | Nov 22nd, 2006 10:20 |
| Advanced search form | victory | Classic ASP | 1 | Mar 4th, 2005 20:57 |