Jump to content

Archived

This topic is now archived and is closed to further replies.

charlieholder

[SOLVED] obfuscating e-mail addresses

Recommended Posts

This is my very first post. I just joined this forum today. I've heard a lot about it so don't let me down!

I am very new to PHP. In fact, I just acquired my own hosting account and domain name about 2 weeks ago. I'm struggling through teaching myself and it's going very slow.

And now my question:
Is there a best practice was for obfuscating e-mail addresses in PHP or would something as simple as using ASCII be good enough to confuse spam crawlers?

Share this post


Link to post
Share on other sites
You mean create random (unreal) email adresses?

Orio.

Share this post


Link to post
Share on other sites
The way I see it, there are 2 ways to do this. One is to use a contact form where your email address stays server-side, and the other is to use character entities. The safest imho is to use a contact form, that way your email address is never presented.

Character entities - [url=http://www.ohlone.cc.ca.us/org/webcenter/emailencoding.html]http://www.ohlone.cc.ca.us/org/webcenter/emailencoding.html[/url]

Share this post


Link to post
Share on other sites
[quote author=gmwebs link=topic=112368.msg455986#msg455986 date=1161552485]The safest imho is to use a contact form, that way your email address is never presented.[/quote]

WOuld that mean like creating a database to store my contact info and whenever I wanted to present it I would have to access the database, run a query for a certain row of data, and echo the result?

That's probably wrong. Because it would just display the text on the page and you could still grab it.

Share this post


Link to post
Share on other sites
I think he means something like this:

http://www.sms-lp.com/inforeq.php

That is something I made for my office. . Basically the script is sending the email and nobody (except for you) ever knows what address it goes to. 

(Please don't spam it too much as my secratary might get a little pissed =-D )

Share this post


Link to post
Share on other sites
Yeah that is one way to do it which will send the form to one or more email addresses which you provide in the mail script. Alternatively, you could also provide a drop down list of recipients, and then send the mail to the relevant recipient based on the value in the POST data to the mail script.

[code]
<?php

$recipient = $_POST['recipient_field'];

switch ($recipient) {

default:
//send email to webmaster
break;

case "person1":
//send email to person1@somewhere.com
break;

case "person2":
//send email to person2@somewhereelse.com
break;

}

?>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.