PDA

View Full Version : hiding email with php


gavimobile
04-06-2008, 10:28 PM
hey dj,
its been a while since i visited. how are ya! hope all is well!
Once again im reviewing your great tutorials. I have a database list which repeats records.

ID NAME PASSWORD Email
1 name1 password1 1@email.com
2 name2 password2 2@email.com

I can put the email in a
echo "<a href='mailto: (y)" . $row['Email'] . '>Contact ME</a>;

but i can still see the email in the code source.

If you wanted to hide email addresses to keep harvesters away, what would you do in this situation?

thanks,
gavimobile

domedia
04-06-2008, 11:03 PM
Is this only for DJ? :-/ Send him a PM ;-)

Anyways. PHP does nothing on the client side, so this is not a PHP question. You use PHP to generate client code, HTML etc.

2 popular ways of doing this:
1. Don't publish the email at all, use a form for people to contact.
2. Hide the email address behind some JS code. Unfortunately, this means that the emails will not be available for anyone not understanding JS.

gavimobile
04-07-2008, 05:42 AM
domedia thanks! ill look right into it

good day!

student101
04-08-2008, 07:39 PM
hey dj,
I can put the email in a
echo "<a href='mailto:" . $row['Email'] . '>Contact ME</a>;
but i can still see the email in the code source.
If you wanted to hide email addresses to keep harvesters away, what would you do in this situation?
thanks,
gavimobile

http://javascript.internet.com/miscellaneous/hide-e-mail-address.html

http://www.hide-email-script.com/

http://www.ezau.com/latest/articles/0158.shtml

http://javascript.about.com/library/blemail1.htm

http://www.csarven.ca/hiding-email-addresses

http://www.mways.co.uk/prog/hidemail.php

Hope those help you achieve what you need.

Cheers

m1a2x3x7
04-09-2008, 05:43 PM
is "email harvesters" really that bad these days?

student101
04-09-2008, 05:52 PM
Yes!!!
They are freakin' terrible!

It's the worst job to have, what if there isn't anyone on the receiving end?
Just joking, but they are crap!

At one time I personally was receiving over 300 spams a day(due to some idiot that used my personal email address in one of their scripts), had the logs to prove it

Cheers

nanny
04-28-2008, 03:10 AM
This is the way I do it:
<a href="contactbusiness.php?listingID=<?php echo $row_listingdetail['listingID']; ?>">
if (!empty($row_listingdetail['email'])) echo 'Email Us'; ?></a>

It not empty it goes to a contact form and go from there.
Empty can also be 0 so you must validate your email addresses prior so that you don't get somebody placing 0 as the email address.
In the contact form I use:

$to = $row['email'];

gavimobile
04-28-2008, 04:39 AM
This is the way I do it:
<a href="contactbusiness.php?listingID=<?php echo $row_listingdetail['listingID']; ?>">
if (!empty($row_listingdetail['email'])) echo 'Email Us'; ?></a>
It not empty it goes to a contact form and go from there.
Empty can also be 0 so you must validate your email addresses prior so that you don't get somebody placing 0 as the email address.
In the contact form I use:

$to = $row['email'];


haha thanks for the reply, i took care of this issue!