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);
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|