zot — 2013-08-01T08:17:11-04:00 — #1
I had used the following code which was supposed to help stop e-mail collection & spam.
Then someone said the link was not working with their iPad. So I reverted to plain old @ and .com to get it working.
Is this bad practice?
Why would their iPad not parse the html properly?
Is there another "easy" method to stop spam when a mailto link is necessary?
Appreciate any comments.
stevie_d — 2013-08-01T09:35:33-04:00 — #2
If you use @, that should have the same effect as @. As far as I know, it should work on all devices, but I don't have an iAnything so I can't check it...
felgall — 2013-08-01T15:56:25-04:00 — #3
only in HTML - not in URLs and the mailto: on the front of the address indicates that it is supposed to be a URL rather than HTML.
Anyway with the mailto: there you may as well use @ since the mailto identifies it as an email address regardless of any obfuscation applied.
picnictutorials — 2013-08-01T17:31:35-04:00 — #4
I don't get any spam using this. Knowbody would.
zot — 2013-08-04T08:46:34-04:00 — #5
Thanks Stevie D and felgall for your replies. Thanks Picnic for your link - that's quite a comprehensive list! I like solution 2 and will try that next time I need.
picnictutorials — 2013-08-04T09:04:51-04:00 — #6
Why your just going to use the masked @? FYI that may trick 1 out of 20 bots.
zcorpan — 2013-08-04T16:51:13-04:00 — #7
Presumably the URL is supposed to be in an attribute value, where entities work fine and are perfectly allowed in all versions of HTML.
felgall — 2013-08-04T17:25:54-04:00 — #8
The %40 should also work in an attribute value that is allowed to contain a URL so that it isn't working is an indication that it is not being used in an HTML attribute.
force — 2013-08-05T01:46:57-04:00 — #9
If you want to encode the HTML characters and still use a mailto link, you will also need to encode the "mailto:" as well. For some reason, you can't mix the two.
$ascii = NULL;
for ($i = 0; $i < strlen($string); $i++)
$email = string_to_html_ascii('firstname.lastname@example.org');
echo '<a href="'.$mailto_ascii.$email.'">email me</a>';
zcorpan — 2013-08-12T09:16:53-04:00 — #10
"mailto link" in the subject indicates otherwise.
That %40 isn't working could just be a bug in the browser or the email app or the OS glue.