News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Douglas Clifton's Blog:
Authenticating a Googlebot in PHP and Perl
September 25, 2006 @ 07:14:02

On his site, blogZero, Douglas Clifton shares his method for authenticating a Googlebot in both Perl and PHP. Basicslly, making sure that the bot hitting your server with the user agent containing Google is, in actuality, really from the search engine.

Following a tip from How to verify Googlebot. In a nutshell, it explains how to use the Unix shell program host to authenticate that an IP address copied from your Web server log file really is a Googlebot and not some email harvester (or whatever).

I decided to take this a step further and demonstrate how you can automate this procedure using a scripting language.

He looks at methods using both programming languages and decides on showing off the PHP version first. It uses a simple method, made even easier by two of PHP's internal functions, gethostbyname and gethostbyaddr. The Perl version relies less of the "higher level" that PHP's functions use and opts for making an actual Socket object to handle the incoming request.

0 comments voice your opinion now!
authenticating googlebot perl gethostbyaddr gethostbyip authenticating googlebot perl gethostbyaddr gethostbyip


blog comments powered by Disqus

Similar Posts

Yahoo Developer Network: 'Tis the season for developers' calendars

Ligaya Turmelle's Blog: 25 Ways to help out PHP

Douglas Clifton's Blog: Authenticating a Googlebot in PHP and Perl

Patrick Allaert's Blog: Coding standards: converts PHP4 style constructors to PHP5 one

Richard Thomas' Blog: The Pie in jQPie (and a Contest)


Community Events

Don't see your event here?
Let us know!


list opinion introduction version example release series language framework voicesoftheelephpant interview community api php7 podcast extension laravel library laravel5 unittest

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework