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?

Recommended Answers

All 3 Replies

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

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!

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.