Jump to content

[SOLVED] obfuscating e-mail addresses


soycharliente

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?
Link to comment
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]
Link to comment
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.
Link to comment
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 )
Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.