Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Encode Your Email Address, Confuse the Spam Bots, but not your viewing clients
jlhaslip
post Oct 15 2007, 09:33 PM
Post #1


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,326
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol
myCENT:97.30



Spam bots often 'scrape' pages to glean information and collect email addresses. I don't like that.
To combat the Bots from collecting my address off of my site, I wrote a script that includes 'obscures' the address in several ways.

It adds 'AT' where the '@' sign is and then replaces the '.' with 'DOT' so it is humanly readable, but not by the Bots.
Also, it encodes the 'mailto' and the address used in the 'mailto' so it shows okay on the web page and on:hover, but it is actually encode into hex values on the page. Sort of like Html Entities, which 'most' Bots cannot read. But they are becoming smarter all the time, so there is no guarantee that this will work all the time for all Bots..

The demo site can be used to create the obfuscated (Whew, big word!) link tag for use on your own site if you are new to Web site building and do not yet feel comfortable with coding php or templates..

Experienced Developers/Coders can download the core components from here. Three functions. I wrote the functions so the code would be re-usable for other tasks.

One function replaces the '@' and '.'.
The other one is a generic string encoding function. It could also be used to encode code snippets on your pages, too... biggrin.gif
Go to the top of the page
 
+Quote Post
shadowx
post Oct 15 2007, 09:42 PM
Post #2


Look around, what do you see? Incorrect.
***********

Group: [HOSTED]
Posts: 1,126
Joined: 12-April 06
From: Essex, UK
Member No.: 21,719
myCENT:29.25



Nice bit of code there!

nowadays whenever i make a contact page i always use a PHP MAIL command to hide the address and i avoid writing my email address anywhere on the net too but it can be useful to create MAILTO links and this is a good way of protecting them

When making a website for a relative they needed a contact page and wanted an image link with a MAILTO so i may very well end up using this little snippet if thats ok with you?

Im more than happy to put a mention in the source code but as its for a paying client im reluctant to have a user-visible mark. Of course my use of the code is up to your discretion smile.gif
Go to the top of the page
 
+Quote Post
jlhaslip
post Oct 15 2007, 10:25 PM
Post #3


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,326
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol
myCENT:97.30



I have a version which produces an Image link, too. The Image can get created dynamically, or from a saved file if it is available, but there is a problem with accessing the Fonts here on the Trap, so I didn't post that one.

If you need the code for the Image-based version, PM a request. It works fine on my localhost (XAMPP) installation. If you have GD with T1Lib installed, which a standard XAMPP does, it will likely work on your machine.

And all of my stuff is Licenced under the Creative Commons - attributtion - share-alike standards, so, yes, you may borrow the code. Simply retain the copyright in the script and pass it on. Whether you alter the code or not, the copyright needs to follow it.

A link-back is not required, but that would be nice. smile.gif
Go to the top of the page
 
+Quote Post
shadowx
post Oct 16 2007, 11:10 AM
Post #4


Look around, what do you see? Incorrect.
***********

Group: [HOSTED]
Posts: 1,126
Joined: 12-April 06
From: Essex, UK
Member No.: 21,719
myCENT:29.25



QUOTE
And all of my stuff is Licensed under the Creative Commons - attribution - share-alike standards, so, yes, you may borrow the code. Simply retain the copyright in the script and pass it on. Whether you alter the code or not, the copyright needs to follow it.


Good news then! The copyright will follow it if i do indeed use this code. I wont put a link back thats visible because this website is for a paying client but if i use the code on any of my websites then i will definitely have a link back, i hope you dont mind that smile.gif

I wont bother with the image code as im not a fan of using the GD library and image manipulation in PHP as its a bit too object orientated for me, but one day i will branch into OO PHP

Thanks for letting me and everyone else use the code, im sure it will be very useful
Go to the top of the page
 
+Quote Post
jlhaslip
post Oct 16 2007, 07:27 PM
Post #5


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,326
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol
myCENT:97.30



*UPDATED OCT 16/2007*

Fixes:
1.) Corrected the Download Link - removed an extra character in "iindex"
2.) Corrected the default email address displayed - removed a trailing 'a'
3.) Added additional check for bad User input - function to clean some bad stuff
4.) Converts html entities - again, a security issue

That should do it for now. Let me know if you have any difficulties with the script.

Thanks.

*UPDATED OCT 17/2007*

Fixes:

5.) Fixed validation of "&'s"in the Trap link
6.) Corrected Licence link to Creative Commons
Go to the top of the page
 
+Quote Post
jimmie32
post Oct 20 2007, 06:44 PM
Post #6


Newbie [Level 1]
*

Group: Members
Posts: 13
Joined: 10-October 07
Member No.: 51,423



I Encoded like this:

myname[dot]32[at]gmail[dot]com

But there is a another way, like:

Before: myname.32@gmail.com
After: NOSPAM---myname.32@gmail.com

Adding NOSPAM is great too.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Mail Form (php)(3)
  2. Php Emailer/contact System(20)
  3. Who's Viewing My Site?(11)
  4. Email Script/form With Php(35)
  5. ---> How To Stop Spam <---(6)
  6. Secure The Email Addresses On Your Website!(10)
  7. Verifying Email Addresses(9)
  8. Configuring Dns Settings For Website(1)
  9. Sending + Receiving Email Via Telnet(10)
  10. Building An Address Book With Java(1)
  11. Verifying Your Email Address(0)
  12. How To Disable Firefox's Awesome Bar(7)


 



- Lo-Fi Version Time is now: 1st December 2008 - 07:08 PM