LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2006, 01:04 PM   #1
tooparam
Member
 
Registered: Nov 2005
Location: India
Distribution: Slackware
Posts: 51

Rep: Reputation: 15
How to add google search on my site


Hi there.

I'm learning to build a web site using php and postgresql/mysql on Linux platform. I want to add google search on my site. How to do it. Please show me the right direction.
 
Old 01-03-2006, 01:23 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
go to google.com and there are link with code you can just copy/paste to add the google search banner to your site.
 
Old 01-03-2006, 01:24 PM   #3
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Quote:
Originally Posted by tooparam
Hi there.

I'm learning to build a web site using php and postgresql/mysql on Linux platform. I want to add google search on my site. How to do it. Please show me the right direction.

Well, on the google site they have an api that lets you add complex google search functionality to your website. However, at its simplest, a google search just retrieves the URL with the format:

http://www.google.co.uk/search?hl=en...G=Search&meta=

where in this example my two search words were steve and dave. Google just joins them with a + sign. So, at the most basic level you need a box to take search words from your visitors, form them into the correct syntax (i.e. join them with + signs and anything else google does (what if people specify + or - to include or disregard words from searches?) and then pop it into the middle of that URL and redirect people to that. If you don't want them actually redirected to google then you'll have to retreive the page and do some parsing of your own to get the results for you to display in your own way.
 
Old 01-03-2006, 01:27 PM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Quote:
Originally Posted by lleb
go to google.com and there are link with code you can just copy/paste to add the google search banner to your site.
Aha...I looked but couldn't find this...
 
Old 01-03-2006, 02:15 PM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by Komakino
Aha...I looked but couldn't find this...
seems they took it off of their site, but found this link for you:

http://www.digitalpoint.com/tools/search/

enjoy. seems they have a bit of html at the bottom of the page that will custom make a google search banner for your site with your URL.
 
Old 01-05-2006, 01:40 PM   #6
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Moved to programming as it is kinda of a programming issue...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using google to search LQ dr_zayus69 Linux - General 1 03-23-2005 08:23 AM
Google search on CD Zuggy General 1 12-17-2004 09:55 AM
Try this Google search the_imax General 11 12-12-2004 04:08 AM
Firebird; Australian Google Search RJW General 0 12-05-2003 08:48 AM
Google search feature Mik LQ Suggestions & Feedback 4 03-07-2003 01:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration