Web Hosting Forum | Lunarpages

Author Topic: Adding a Google Search on Your Site  (Read 7830 times)

Danielle

  • Guest
Adding a Google Search on Your Site
« on: March 20, 2004, 01:09:09 PM »
Here is the code to add a Google search form to your site and ensure it is only searching for pages on your site that Google has spidered (you must have pages spidered by Google for this to work):

Code: [Select]
<script>
function CheckForm(e)
{
if( e.q.value=="" ){
alert('You must enter seach words');
e.q.focus();
return false;
}
e.q.value += " site:www.domain.com";
return true;
}
</script>
<hr>
<form name=abcd action="http://www.google.com/search" onsubmit="return CheckForm(this)">
<input maxLength=256 size=55 name=q value="">
<input type=hidden name=ie value="ISO-8859-1">
<input name=hl type=hidden value=en><br>
<input type=submit value="Google Search" name=btnG>
<input type=hidden name=meta value="">
</form>


Remember to replace www.domain.com with your domain name.

This code is courtesy of girish at www.langchat.com  :thumb:

Offline Pete

  • Alien Anomaly
  • Senior Moderator
  • Professor in Nanotechnology
  • *****
  • Posts: 4258
    • X-Visions Website Design
Adding a Google Search on Your Site
« Reply #1 on: March 21, 2004, 11:00:43 AM »
Danielle said
Quote
.........searching for pages on your site that Google has spidered (you must have pages spidered by Google for this to work):  


So..
er..  :oops:
                 How do you know if youve been 'spidered'  :?

      (Apart from little foot marks and cobwebs all over your body)
x-visions.com


As I'm always saying.. (But nobody listens)
"Take a step back.. Take a deep breath and see if there a simple solution there, thats hiding" lol  :DLunarpages Web Hosting   Lunarpages Forums  Lunarpages Affiliate Program

Danielle

  • Guest
Adding a Google Search on Your Site
« Reply #2 on: March 21, 2004, 11:03:32 AM »
Hi Pete,

Well, you would put the code on your page and, if no results are returned, you haven't been. :P

I hope this helps.  ;)

Offline girish

  • Intergalactic Cowboy
  • *****
  • Posts: 58
    • http://www.langchat.com/
Adding a Google Search on Your Site
« Reply #3 on: March 22, 2004, 06:17:02 AM »
To know whether you have been spidered go to google.com and
search for

site:www.yourdomain.com


For a working sample of the search go to
http://www.langchat.com/search.asp

search for 'lunarpages' in that page. :thumb:

Offline ryan.

  • Galactic Royalty
  • *****
  • Posts: 306
Adding a Google Search on Your Site
« Reply #4 on: March 22, 2004, 11:27:50 AM »
Also, to know if someone else out there is linking to your site, just search google for

link:www.yourdomain.com

Note:  You may get different results if you use www or not.

ex: http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=link%3Alunarpages.com&btnG=Google+Search

ryan.
ryan.

Offline sopidy

  • Spacescooter Operator
  • *****
  • Posts: 44
    • http://ketto.org
Adding a Google Search on Your Site
« Reply #5 on: March 26, 2004, 03:49:03 PM »
is it possible to just add a google or yahoo search engine to a website? not necessarily to search in MY site.  i want my users to be able to make my page their home page & be able to make internet searches if they want to.

Offline girish

  • Intergalactic Cowboy
  • *****
  • Posts: 58
    • http://www.langchat.com/
Adding a Google Search on Your Site
« Reply #6 on: March 27, 2004, 06:15:10 AM »
Sure just remove the following line from the above code
Code: [Select]

   e.q.value += " site:www.domain.com";


and then use that form.

Offline robast2

  • Intergalactic Superstar
  • *****
  • Posts: 131
    • http://www.robaston.com
Re: Adding a Google Search on Your Site
« Reply #7 on: April 27, 2004, 06:26:30 PM »
Quote from: Danielle
Here is the code to add a Google search form to your site and ensure it is only searching for pages on your site that Google has spidered (you must have pages spidered by Google for this to work):

Code: [Select]
<script>
function CheckForm(e)
{
if( e.q.value=="" ){
alert('You must enter seach words');
e.q.focus();
return false;
}
e.q.value += " site:www.domain.com";
return true;
}
</script>
<hr>
<form name=abcd action="http://www.google.com/search" onsubmit="return CheckForm(this)">
<input maxLength=256 size=55 name=q value="">
<input type=hidden name=ie value="ISO-8859-1">
<input name=hl type=hidden value=en><br>
<input type=submit value="Google Search" name=btnG>
<input type=hidden name=meta value="">
</form>


Remember to replace www.domain.com with your domain name.

This code is courtesy of girish at www.langchat.com  :thumb:


What is benefit of having visiots leave your site via a search form?  :wink:
Cheers,
Rob Aston
www.robaston.com
 
Mail     :     1 Princes Court,  2351 Cambridge, New Zealand
Phone :     + 64 7 827 7045
Email  :       rob@robaston.com

Offline girish

  • Intergalactic Cowboy
  • *****
  • Posts: 58
    • http://www.langchat.com/
Adding a Google Search on Your Site
« Reply #8 on: May 01, 2004, 05:50:45 AM »
It is now official

Google has now officially allowed website owners to add a google
search to their website

http://www.google.co.in/searchcode.html

Offline car-loan

  • Space Explorer
  • ***
  • Posts: 6
    • http://www.car-loan-wiz.com
What Google Results Get Displayed
« Reply #9 on: May 02, 2004, 02:27:33 PM »
Having Google search on your site is a great way for people to find just what they're looking for in your content vs. having to follow navigation structure, etc.

Note that this search function specifically limits results to those from your site.

Cheers!
http://www.car-loan-wiz.com  - Car Loan Wiz provides auto loans info, tips on car loans, and a auto loan calculator - Find bad credit car loans or use our car loan calculator - Learn about auto loan rates and refinance car loan sources. Refinancing auto loans is easy with our low rate auto finance links.

Offline Tito

  • Spacescooter Operator
  • *****
  • Posts: 42
Adding a Google Search on Your Site
« Reply #10 on: July 19, 2004, 07:33:32 AM »
And if you want to make a little money, go to www.google.com/adsense.

You get the Google searchbar code specifically tailored for your site.  Search results open up in a different page with your logo on top.  If people click on the Google ads on top, you get paid.

If you're gonna give Google free advertising, might as well get something out of it.
I'm such a newbie.  Please forgive my ignorance.

Offline JD

  • Galactic Royalty
  • *****
  • Posts: 243
    • http://WWW.THEREBELBRIGADE.COM
Adding a Google Search on Your Site
« Reply #11 on: July 31, 2004, 07:28:03 PM »
Google has sold there cyber soles. Get ready to see another dot/com tank before your cyber eyes. *L*
Put Down the Mouse and Step Away From the Computer.

Offline cavarran

  • Space Explorer
  • ***
  • Posts: 6
Adding a Google Search on Your Site
« Reply #12 on: August 24, 2004, 01:41:33 PM »
How about web content stored in a database? How does google grab that? or does it? If not, what are some solutions to be able to search database driven websites? I really really need to know!

Peter

Offline RickJ

  • Senior Moderator
  • Über Jedi
  • *****
  • Posts: 2658
Adding a Google Search on Your Site
« Reply #13 on: January 28, 2005, 06:40:37 AM »
I like the alternatives that picosearch.com and freefind.com offer.  With them you can be sure every single page in your site is searched when users search...without worrying, wondering, or digging around to find out if Google has spidered it.

The downside: The free versions have ads.  You pay to have them without ads.
Rick.
Trying to daydream, but my mind keeps wandering.

 

Share |