Forum Moderators: coopster
To avoid email harvesters nabbing my clients emails would it be benneficial for me to create a script which when a user clicks an email link i.e.
where id represents a number associated to an address in a database table -> emails.php?id=1
and is then redirected to a page with the appropriate header output to initiate the default mail client with the desired email address?
If its worth it, how would i setup the headers to perform such an action (Ive already employed a contact form on the website but think its essential that end users/customers have access to actual/legit emails so as to send mail via their own mail clients/method)
I was considering the option of a script which utilises the GD extension to display the address' as an image on the page, however i would still require the above mentioned to be able to send the emails when a user clicks the link.
TIA
<form action="contactdirector.php" method="POST">
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti?>" />
Your Name: <br />
<input type="text" name="name" size="35" />
<br />
Your Email:<br />
<input type="text" name="email" size="35" />
<br />
Comments:
<br />
<textarea name="comments" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
</form>
<!-- ---------------------------------------------- -->
And this is the php it posts to:
<?php
$myemail = "user@mydomain.org";
if(!$email == "" && (!strstr($email,"@") ¦¦!strstr($email,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($name) ¦¦ empty($email) ¦¦ empty($comments )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $badinput;
$todayis = date("l, F j, Y, g:i a") ;
$subject = $attn;
$comments = stripcslashes($comments);
$message = " $todayis [EST] \n
Message: $comments \n
From: $name ($email)\n
";
$from = "From: $email\r\n";
if (($ccopy == "ccyes") && ($email!= ""))
mail($email, $subject, $message, $from);
if ($myemail!= "")
mail($myemail, $subject, $message, $from);
if ($ccx!= "")
mail($ccx, $subject, $message, $from);
?>
<p class="centered_data">Message received on:<br />
<?php echo $todayis?>
<br />
Thank You, <?php echo $name?>! <br />
( <?php echo $email?> )
<br />
<br />
<br />
Your message:</p>
<p class="centered_data"><table border="1" cellspacing="0" cellpadding="15">
<tr>
<td>
<p><?php $commentsout = str_replace("\r", "<br/>", $comments);
echo $commentsout;?> </p>
<br />
</td>
</tr>
</table></p>
<br />
<p class="centered_data">Thank you for your comments!</p>
<!-- ---------------------------------------------- -->
Because the php page sits on the server, the email address listed in the code is not visible to the outside world.
Hope this helps. I'm new at this, but have found this works for me.
I know there to be javascript encrypters so on etc but at the end of the day once someone has reversed the workings and found the method used to encrypt, that renders it useless as far as those harversters go that are dynamic enough to decrypt address'
I made a script which again loads emails dynamically from a database from a given ID in a GET request URL and simply populates the header function to redirect/perform the actions of the mailto: a href link but was unsure as to weather harvesters would pick up on this or not?
Any more suggestions/comments would be appreciated.
That's what I did, and to this day I haven't had spam in my inbox.
js file should look something like this (or different, if you like):
function email()
{
var name = "encode-this-with-entities+hex(before@)"; /*this isn't readable*/
var domain = "same-with-this(domain)"; /*ditto*/
var rname = "normal-text"; /*this is*/
var rdomain = "example.com"; /*hide the dot if you feel it is too vulnerable*/
document.write ( '<a href=\"mailto:' + name + '%40' + domain + '\">');
document.write ( rname + '@' + rdomain + '<\/a>');
}