It was asked that I post my alterations, Well I haven't tested it yet but heres my second draft.
#!/usr/bin/perl -w
use strict;
use CGI ':standard';
use Regexp::Common qw(RE_profanity);
print header();
print start_html();
print "<html><head><title>Thanks for Signing!</title></head>";
print "<body bgcolor=black text=white>";
my $q=new CGI;
my $name =$q->param('name');
my $mail =$q->param('mail');
my $message =$q->param('message');
print "<center><p>Thanks for signing my guestbook, your message
+has been posted! $name!</center></p>";
# REMOVE THIS COMMENT TO ACTIVATE CENSOR $message =~ s/$RE{profanity}/
+bleep/msg;
foreach ($name,$mail,$message) {
s/</</g;
s/>/>/g;
};
foreach ($message,$mail,$name){
s/\(b\)/<b>/ig;
s/\(i\)/<i>/ig;
s/\(\/b\)/<\/b>/ig;
s/\(\/i\)/<\/i>/ig;
};
foreach ($message,$mail,$name)
{
s/\(red\)/<font color=red>/ig;
s/\(\/red\)/<\/font>/ig;
};
if ($message =~ /\(red\)/i and $message =! /\(\/red\)/i) {$message=$me
+ssage."</font>"};
print "Name: $name <br> Email: $mail <br> Message: $message";
open HTML, ">>../gbook.html" or die $!;
print HTML "<i>Name:</i> $name <br> <i>E-Mail: </i>$mail<br> <i>Messag
+e: </i>$message <p>";
close HTML;
print "</BODY></HTML>";
I've used a couple of the suggestions so far, when I get home I'll mess around with it more. And thank you all for the comments, I found them very helpful.
-
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.
|