Jump to content

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


whatnow

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.
Link to comment
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();
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.