esn003 — 2012-12-31T09:18:34-05:00 — #1
I have this search bar on my site that begins with:
<form id="searchform" class="non-widget" action="http://www.mysite.com/" method="get">
This is going to sound silly, but how do I replace the url in the action statment with multiple urls of my choice?
Any help is realy appreciated.
esn003 — 2013-01-01T08:31:37-05:00 — #2
2ndmouse — 2013-01-01T10:26:29-05:00 — #3
I suggest you aim the form at a script file and have that take care of querying your multiple urls. There's an example here.
esn003 — 2013-01-01T11:52:04-05:00 — #4
Maybe I need to tell you more about what I am trying to do.
I have kind of library site with all kind works published in it and, like mine, there are some other sites of the same kind.
I need to use an 'action' that will go searching my site and then the other sites (of my choise) for the same key word.
I was thinking of something like comma separated site names.
lemon_juice — 2013-01-01T12:14:07-05:00 — #5
A form cannot have multiple urls as action. And how do you imagine your idea of action "searching your site and other sites" to work? When you submit a form to a url then the browser is redirected to this url and the action results (search results) are displayed at this url. Redirecting to multiple urls doesn't make sense since a single browser window can open only 1 url. You need to tell us more how you imagine this to work. Multiple iframes? Multiple windows? Single page with results from all searches?
esn003 — 2013-01-02T04:34:57-05:00 — #6
Single page with results from all searches. Something to Google search by only on specific sites
lemon_juice — 2013-01-02T05:06:12-05:00 — #7
Then I don't think there is any other way than what 2ndmouse said above. Submit the form to a php script and have the script load the search results from the other sites (for example using curl) and combine them into a single html page. This may or may not be easy depending on how the result pages are structured, how different they are and most probably this will require some html parsing.
esn003 — 2013-01-02T05:29:46-05:00 — #8
Thank you so much for you tips. I will have to start digging into what 2ndmouse said(thank him too).
Off topic: My wife is Polish.
cups — 2013-01-02T12:25:37-05:00 — #9
Doable with JS, but that can be turned off.
Each of your target sites might require different q= variables though ...
lemon_juice — 2013-01-02T16:25:25-05:00 — #10
Compiling search results from multiple pages can take a long time but it can work well for 2 or 3 sites...
Polish women are pretty :)[/ot]