954,190 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

script to call google search?

Hey everyone, I need a little snippet of code that I can use to call a google search. I know I can just use html to link to a google search with a predefined search string in the search box, but what I'd like to do is create a little text box where my users can input a search term and click "search", and then the code would pass that search on to google. I know it's easier just to go to google and type in the search yourself, but I need extra predefined text added to the search string in addition to what the user inputs to the search box.

Here's the example. The user types in the search box, "computers."

I would like the script to place the word "computers" in some other search text, say, "future of" + "computers" + "family values". Or something to that effect. So basically, I want the script to take the {user search} and call a google search with that {user search} placed in the middle of my predefined search terms.

Any ideas?

nathanpacker
Posting Whiz in Training
234 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

DELETE: Don't mind me, didn't notice this was for PERL

DavidRyan
Posting Whiz in Training
229 posts since Jul 2006
Reputation Points: 22
Solved Threads: 11
 

Well, that would work, only I'm hosting on a unix system, so I need to use perl or php or something. ASP or VB won't really work.
Thanks though!

nathanpacker
Posting Whiz in Training
234 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

I think I found something that will work. I wrote it in perl. Basically the form calls the script, and the script just uses a redirect and redirects to a google page with the search criteria in the scipt, as well as whatever the user puts in the form. It seems to be working. Thanks!

nathanpacker
Posting Whiz in Training
234 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You