SPAM and a couple of ways to protect your email address

March 30th, 2009

The one question I get asked is “how can I reduce the amount of SPAM that I receive?”.  The kinds of emails people are talking about in this instance are ones that you haven’t asked for, unsolicited emails. If you sign up for a newsletter  then expect to receive it, furthermore, depending on the kind of website or kind of newsletter or business you are signing up to, also be aware that you may receive further emails.

One of the main areas to look at if you are receiving a lot of SPAM is your website.  Traditional HTML will include a piece of code which reads href=”mailto:test@test.com”.  The key element here is the mailto part: there are programs call SPAMBots which are programmed to surf the internet and collect email addresses from which ever website they come across.  Amongst other elements, they specifically look for mailto tags. There are easy ways to protect an email address, the easiest probably being the use of javascript: the following is a useful example of how to protect your email address using javascript:

Instead of:

<a href=”mailto:test@test.com”>test@test.com</a>

Write:

<script language=”javascript” type=”text/javascript” src=”email.js”/>

Create a file called ‘email.js’ and copy & paste the following:

user = “test”;
site = “test.com”;

document.write(’<a href=\”mailto:’ + user + ‘@’ + site + ‘\” title=\”Click here to email us…\”>’);
document.write(user + ‘@’ + site + ‘</a>’);

This example does not guarantee that your email address will never be harvested and it obviously doesn’t stop someone from visiting your website and manually adding your email address to a SPAM database.

Another ‘soft’ target in terms of SPAM are contact us forms and alike. Ensure that you ask the user to validate their details before they are able to click ‘Submit’:

<head>
<script type=”text/javascript” language=”javascript”>
var randomNo;

function randomNumber(){

randomNo = Math.floor(Math.random()*100000000);
document.getElementById(”randomNoText”).innerHTML = randomNo;

}

function validate(){

if(document.getElementById(”securityNumber”).value == randomNo){
return true;
}else{
alert(”Please enter the correct number”);
return false;
}
}

</script>
</head>
<body onload=”randomNumber()”>
<form onsubmit=”return validate();”>

<p>Enter the following number below: <span id=”randomNoText”></span></p>
<input type=”text” id=”securityNumber” />
<input type=”submit” value=”Submit Details” />

</form>

<input type=”hidden” id=”submitValidate” />

</body>

The user will be prompted for the right answer before they are allowed to proceed and submit their details. Once again this does not stop someone from manually entering rubbish details but it prevents automated bots from flooding your inbox with emails. A good area to implement this would be on a comment form to say a blog post.

For alternative ideas put the word “captcha” into Google.

Why Has The Cursor Changed In Photoshop?

March 24th, 2009

photoshopOK, a simple one to begin with, but something that I remember haunted me a few years ago after I had completed my Photoshop training and started out into the wonderful world of professional web design.

After spending a considerable amount of time at college learning photoshop techniques from masking, filters, layers etc. I was confident that I knew enough to tackle Photoshop design in a work environment but on the first day something happened that threw me into confusion. When I used Photoshop and used the brush tool, instead of the customary cursor there was just a cross hair – now this was terribly annoying if the brush was anything larger than 1 pixel in size as you couldn’t see the outline of the brush and predict where your line should be. What was more infuriating was that my last gasp effort in sorting anything out ie. switch it off and then on again… didn’t solve the problem.

I was used to seeing a brush outline that indicated the size of the brush that I was using, so what could the problem be? After a bit of Googling and hunting down I found out that the CAPS LOCK was on.

CAPS Lock, other than affecting text in Photoshop will change your cursor (Photshop CS anyway) to a cross hair, presumably for accuracy… though as I have mentioned if you are used to seeing a brush outline can be confusing. The thing with this little cursor change is that it is affected by your keyboard activity outside Photoshop, so if you have been editing text or accidentally hit the Caps Lock key then you will be affected with a cursor change when Photoshop starts up.

Just one of those things they don’t teach you which you just have to pick up I guess…