Forum Moderators: coopster

Message Too Old, No Replies

base64 encode question

         

screwywabbit

6:41 am on Feb 26, 2007 (gmt 0)

10+ Year Member



This may sound like a silly question but here it goes. I have formmail on my site but there are certain areas I would like to place standard mailto: links. We all know the problem with bots snatching up email addresses. I was just wondering if I use base64 to encode my email address would that work as far as protection goes? Im not big on using images, or JS methods.

Thanks all

mcibor

2:58 pm on Feb 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the mail programs support it, then it looks as if the bots won't solve it.
However if they check only for mailto, then it's possible to decode if someone takes effort.

In js resolution there is no mailto: and no @, therefore bot usually omit it.
Here you won't have @, but you would still have mailto, so it might pose a problem.

Regards
Michal

dreamcatcher

4:41 pm on Feb 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



screwywabbit, is there any reason you don`t want to go with a captcha? Another solution is to have a randomly generated sum and have a user input the result. Nice and simple, but pretty effective.

dc

screwywabbit

11:31 pm on Feb 26, 2007 (gmt 0)

10+ Year Member



Hello and thanks for the replys all. dreamcatcher I think you misunderstood my question sorry if I wasn't more clear. I do have a general contact form on my site which uses captcha. What I would like to do is place a few basic mailto links in several locations so users can click and send mail though there email program, not using my contact form.

So instead of use the standard <a href="mailto:me@mydomain.com">contact</a> I was wondering if I used base64 to encode and decode my address would that protect me from bots? Or do they have the capabilities to read it? I don't know exactly what bots have the ability to do.

(ex)
$str = 'PGEgaHJlZj1tYWlsdG86c29tZWJvZHlAZG9tYWluLmNvbT5jb250YWN0PC9hPg==';
echo base64_decode($str);

Thanks again

dreamcatcher

9:24 am on Feb 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you had the address encoded on the page, the mailto link isn`t going to work. If you decode it, its the same as displaying it normally because it will need to be decoded before anyone clicks it. I doubt PHP can control the way the browser displays the link, but JS can, via its encryption methods. You can envoke the mailto link by using:

header("Location: mailto:email@example.com");

So, maybe use that and place a link on your page?

<a href="index.php?cmd=email">E-Mail Me</a>

if (isset($_GET['cmd']) && $_GET['cmd']=='email')
{
header("Location: mailto:email@example.com");
exit;
}

Simple enough, although you might find Firefox opens a blank white page when you use it.

dc

screwywabbit

6:09 am on Feb 28, 2007 (gmt 0)

10+ Year Member



Thanks dc