0: #!/usr/bin/perl -wT
1:
2: # E-mail Redirect (for protecting addresses from E-mail-Address-Collecting Bots)
3: # by David Glick [davisagli], 6/25/2001
4:
5: # when given an e-mail address in the form "[user],[domain]",
6: # this script returns an HTTP redirect to "mailto:[user]@[domain]"
7:
8: # This can be used to prevent spam-bots from finding e-mail
9: # addresses in HTML links; for example, instead of linking to
10: # "mailto:me@mydomain", you can link to "this_script.pl?me,mydomain"
11:
12: # Comments/improvements welcome; I don't have much experience with CGI.
13:
14: # Update 6/25/2001: The security risk that [bikeNomad] pointed out
15: # shouldn't be an issue now. Also implemented his other suggestions.
16: # Thanks much, bikeNomad!
17:
18: use strict;
19: use warnings;
20: use CGI qw/:standard/;
21:
22: $_ = param('keywords');
23: my ($user, $domain) = m{^([\w!$'*+-/=^.]+),([\w!$'*+-/=^.]+)$};
24: print redirect( -uri => "mailto:$user\@$domain" )
25: if defined($user) && defined($domain); In reply to E-mail Redirect (for protecting addresses from E-mail-Address-Collecting Bots) by davisagli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |