Jump to content


Photo

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


  • Please log in to reply
1 reply to this topic

#1 whatnow

whatnow
  • Members
  • PipPip
  • Member
  • 12 posts
  • Locationuk

Posted 05 April 2006 - 12:12 PM

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.

#2 jamiemcconnell

jamiemcconnell
  • Members
  • Pip
  • Newbie
  • 7 posts
  • LocationUnited Kingdom

Posted 05 April 2006 - 01:17 PM

I am assuming that you have a list of the search engines you are going to query so...


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

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

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


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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users