![]() | ![]() |
The only problem with the JavaScript e-mail obfuscating script presented on this site already is that you have to embed JavaScript into your web page for it to work. I've been looking for an alternative and I have found one in a php script that obfuscates your email address by re-shuffling and then uses plain CSS to make it apear in the web page as a normal email address that people can cut and paste though the underlying code is obfuscated and your email cannot be harvested by automated email harvesters.
The Celtnet email encoding service is completely free and is provided as a service to users of this site., It will ensure that your email address is protected from harvesting by robots and software email trawling programs.
Simply enter your email address and press the encode address button to generate an encrypted e-mail for that address:
To use the code generated simply copy and paste into your own web page but remember to add the CSS code to the page or all you will see is gibberish! An example of what your encoded email looks like to a visitor to your site is given beneath the code that's been generated.
Remember, however, that if you want to print out the email address (and for it to actually look like a real email address in your browser) you will need to add the following CSS code either to your CSS file or to your HTML page (or HTML-based eMail). I actually add this to the HTML page itself just before the end of the </head> tag:
<style type="text/css">
.mstag{position:absolute; font-family:monospace;margin:0.45em;background-color:#fcc};
</style>
You now have everything you need to deploy the php code on your own website. But if you don't want to deploy the entire code you can use the form below to generate the code that will allow you to generate code to obfuscate your own e-mails.
The code for generating the obfuscated email address is based on that of Daniel Hjerth whith a few changes of my own. This code is given below:
function mailshuffle( $mail ) {
$output = array();
$element = "span";
$spacing = 'round($x/1.75, 2)';
$class = "mstag";
$spacing_attribute = "left";
$spacing_type = "em";
for ($x=0; $x<strlen($mail); $x++)
{
eval('$i = '. $spacing . ";");
$output[] =
"<{$element} class='{$class}' style='{$spacing_attribute}:{$i}{$spacing_type};'>".htmlentities($mail{$x})."</{$element}>";
}
if(function_exists("shuffle_variable"))
{
shuffle_variable(&$output);
}
else
{
mt_srand( (double) microtime() * pow(10,5) );
$array_size = count($output);
for($x=0; $x<$array_size; $x++)
{
$n = mt_rand(0, $array_size - 1);
$p = $output[$n];
$output[$n] = $output[$i];
$output[$i] = $p;
}
}
return "<div style='position:absolute;'>".implode("",$output)."</div>";
}
To get this function to work you will need to call it with something like: echo "<p>".mailshuffle($Email)."</p><br/><br/>"; (where $Email is the email you want to obfuscate) which both calls the function with your email address and prints the result to your web page.
Also, remember that you will need to add the following CSS code
<style type="text/css">
.mstag{position:absolute; font-family:monospace;margin:0.45em;background-color:#fcc};
</style>
to any web page where you want the code to disply as an email address.
Not found what you're looking for? Search the web:
One Million People CampaignIf you can spare $1 then help support this site and change someone's life forever? Learn how and why on the One Million People campaign page. Or donate $10 and get my guide to spices ebook or The Recipes of Africa eBook as a gift for your donation! |
As an essentially anonymous medium email is an ideal method of contacting a large number of people. It's also become the communications medium of choice for many individuals. Because of this its becoming a more and more attractive medium for fraudsters and scamsters. However, a few simple steps can protect you from the vast majority of email scams and these are listed in this article.
With the New Year the number of spam and scam emails is increasing once again. But, the scamsters are getting cleverer as well. Below is a new phishing scam purporting to be from the UK bank, Abbey National which should be brought to everyone's attention.
Spam or unsolicited emails are a modern nuisance but it's surprising how many people still fall for the various cons in these emails. But fraudsters are becoming cleverer and the scam emails may now be directed at you personally or may purport to be forwarded from a friend. Here I will briefly take you through the top ten fraud email strategies so that you can recognize the scams and protect yourself.
Spam is the bane of anyone whose businesses involve the internet. If you publish your email on your website then it will be harvested and used by spammers. Learn how to protect your email and fool the spammers' email harvesters.