|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Protect clients email address
I have seen several ideas to do this but the ideas are somewhat old (2006?) and was wondering if there is an up-to-date method of protecting the mailto: address in the HTML. I suspect javascript is no good if the visitor has js turned off in the browser.
__________________
--------------------- Thanks for your time. |
|
#2
|
||||
|
||||
|
If the link needs to be a mailto link, then theres no real way to do it using just HTML unfortunately. You can obfuscate and hard-code the email address, but that isn't going to stop a bot/spider whatever from reading it - obfuscation is only really good for hiding from humans.
Some people have suggested replacing the @ symbol with @ but again, it's just basically trying to trick whoever into thinking that it's not an email address.. however, the thing to remember is that if a href attribute starts with "mailto:" an email address is going to follow - however it's encoded. One thing you can do, is handle the onclick of the link (using JavaScript) and redirect the page to the mailto there - this way you can concatinate a couple of strings to create the email address. This means that bots are less likely to be able to work out whats going on. Code:
<script type="text/javascript">
function sendIt() {
var at = "@";
var user = "user";
var domain = "domain";
var protocol = "mailto";
window.location.href = protocol + ":" + user + at + domain;
}
</script>
It's not great, but it's a start |
|
#3
|
||||
|
||||
|
Thanks, so if I put all that in a js file and do a script statement in the header, what does the footer link change to?
|
|
#4
|
||||
|
||||
|
There are various ways, but this works...
Code:
<p><a href="javascript:sendIt()">Mail me</a></p>
__________________
Cheers, Jamie # mdb4u | mobile movie database | Currently being revamped # skiFFie | Jamie Burns [me] # guidelines | search | wap resources | not getting help | fold to cure __________________ Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. ![]() __________________ |
|
#5
|
||||
|
||||
|
Actually, before I try this, I have just tested mailto: link in Safari and Firefox and Safari posts a message saying Vista can't do it and Firefox just ignores the click. But when I use my other machine IE7 creates an email form from my webmail OK. Anyone know what the solution is for this?
|
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Protect clients email address |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|