Build a simple form to search another site's information

Okay,

I want to create a search form on my site which uses the same fields and options as that of another site’ form from which displays the following in its url when you do a search

search.htm?Service=Disability&keyword=Keyword+Search&Council=All&Search=SUBMIT

Could I re-create the form on my site that would search the site above using php or possbily use a client side option like jqery’s serialize function? http://api.jquery.com/serialize/

That depends if you are:

Just preparing the query string to be sent, and are then relocating the user to CouncilB’s website to see the results

OR

Preparing the query, searching CouncilB’s website but showing the results on your own site (after some scraping/re-formatting)

OR

Simply copying the query parameters to be used on your own website and your own search in which case your form simply uses the GET method.


<form action="search.htm" method="GET">
<select name="Service">
<option value="Disability">Disability</option>
<option value="Parking">Parking</option>
</select>
<input type="submit">
</form>

The resulting URL is

search.htm?Service=Disability

Thanks for this - i’m more looking to redirect the user to thier site so they can continue searching (the first option).

The full url when seraching on thier site is- http://www.familysupportni.gov.uk/search.htm?Service=Drug%2FAlcohol+Misuse&keyword=Keyword+Search&Council=All&Search=SUBMIT

Okay have this done using the GET method - many thanks!

Good on you. So you changed the form action to the equivalent of “http://www.CouncilBWebsite.gov/search.htm” ?

Yep

<form name="orgSearch" action="http://www.familysupportni.gov.uk/search.htm" method="get" target="_blank" onsubmit="return validate_form()">
                    
                    <select name="Service" id="service">
                        <option>Choose a Service</option>.......

.

thanks for making me think about this more logically - i’d like to add a simple clear/reset on the select fields after submiting - are there any snippits out there that could be easily added?