Re: How to stop site flipping?

From: Date: Tue, 14 May 2002 03:17:45 +0000
Subject: Re: How to stop site flipping?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-97481@lists.php.net to get a copy of this message
This might help: I have a php file in my doc root called email.php. Instead of linking an email address with <A HREF="mailto:blah@foo.com">, I link it like this: <A HREF="email.php?to=justin&domain=indent.com.au">Justin French</a> (Actually I do it with a function, but for clarity sake, I'll leave the above in place). email.php isn't a HTML page, it's a small script which sends a mailto: header to the browser: <? // email.php if(!isset($_GET['to'])) { $_GET['to'] = "info"; } if(!isset($domain)) { $_GET['domain'] = "mydomain.com.au"; } $to = $_GET['to']; $domain = $_GET['domain']; $email_address = $to."@".$domain; // send email header to page header ("Location: mailto:$email_address"); ?> As you can see, there are defaults in there, so if they link to email.php?to=justin, the default domain will be used, and vice-versa for a missing "to", or both missing. I tested it in a few browsers, and the original page was not refreshed... an email window popped up in outlook express, just as it would with a regular mailto: link, and everything works fine. This prevents spiders hunting for mailto:something in your pages. Other spiders might look for anything that looks like an email address, so I'd recommend not having regular email address' anywhere: <A HREF="email.php?to=justin&domain=indent.com.au">Justin French</a> instead of <A HREF="email.php?to=justin&domain=indent.com.au">justin@indent.com.au</a> I've seen some simular stuff where the users put in something like a space around the @ to make it harder for the spiders to find the text too, but I dunno if this is that reliable: <A HREF="email.php?to=justin&domain=indent.com.au">justin @ indent.com.au</a> Of course the other option is to strip every email address from your site, and put in a "contact us" form. Justin French on 14/05/02 12:07 PM, David McInnis (david@dataovation.com) wrote: > I have been running a newswire service since 97 and recently noticed an > increase in the number of people flipping our site to harvest email > addresses contained in the news releases posted on our site. (prweb.com) > > I am running apache and php on a linux box. Can anyone suggest > something that I can implement that would block users who are harvesting > data from our site? I do not mind legit users from using this data, but > the flippers are chewing up my bandwidth and db resources. > > I also want to be careful to not block valid search engine spiders from > indexing our site. > > David McInnis >

« previous php.general (#97481) next »