Jump to content

Archived

This topic is now archived and is closed to further replies.

whatnow

taking a variable from a input box and passing it into urls

Recommended Posts

what i'm trying to do is simple but I can't get passed it.

essentially i've got a form with a variable 'searchQry' this is what the user types into and processes when the form is clicked to the PHP file.

I then want the php file to take searchQry and send it to multiple search engines, all of which have different variable names to perform a search, e.g. Google's is 'q', however another might be 'qry' or anything really.

what i'm aiming for is a site which operates very much like a torrent multiple search engine device. The ones where you enter one string and then it'll search all the sites for you with that string.

Any ideas? I could write the pseudo-code if it makes it easier?

tia clever people.

Share this post


Link to post
Share on other sites
I am assuming that you have a list of the search engines you are going to query so...

[code]

if($submit) {
  $searchQry = $_GET['searchQry'];

  // Google Search.
  $gResults = getResults('http://google.com/?q='. $searchQry .'');

  // Yahoo Results.
  $yResults = getResults('http://yahoo.com/search?p='. $searchQry .'');
}

[/code]

i also made up a function to grab the page output from the results getResults();

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.