Okay this what i have so far.
--------------
Guestbook.cgi
This is what the user sees
-------------
#!/usr/bin/perl
print "Content-type:text/html\n\n";
#The Guestbooks backgroundColor
$bgColor = "navy";
#The Guestbooks FontColor
$fontColor = "gold";
#The Name of your Guestbook
$guestbookName = "www.ACJavascripts.com's Guestbook!";
#The Sign Guestbook link's Text
$sign = "Sign My Guestbook";
#Location of WrittingMessage.html
#Example: http://www.yoursite.com/WriteMessage.html
$writeMessage = "http://www.acjavascripts.com/WriteMessage.html";
#hrColor, The Line color that seperates the messages
$hrColor = "lawngreen";
open(INF,"MessageDatabase.dat");
@msg = <INF>;
close(INF);
print "<html><head><title>$guestbookName</title></head>\n";
print "<body bgColor=\"$bgColor\">\n";
print "<BR><center><h2>$guestbookName</h2>\n";
print "<b><a href='$writeMessage'>Sign Guestbook</a><br><br></center>\n";
foreach $KK (@msg){
chomp($KK);
($Email,$Name,$Loc,$message) = split(/\|/,$KK);
$KK=~ s/\;\)/<img src\"http:\/\/www\.acjavascripts\.com\/Images\/happy.gif\">/g;
print "<table><tr><td><b><font color='$fontColor'>Name: $Name</font></b></td></tr><tr><td>\n";
print "<b><font color='$fontColor'>Email: $Email</font></b></td></tr><tr><td>\n";
print "<b><font color='$fontColor'>Location: $Loc</font></b></td></tr><tr><td>\n";
print "<b><font color='$fontColor'>Message: $message</font></b></td></tr></table>\n";
print "<br><hr color='$hrColor'><br>\n";
}
print "<center><sup><h5>Guestbook By www.ACJavascripts.com/CGI/AC-CGI.html</h5></sup><BR><BR>\n";
print "</body></html>";
---------------------------------
This is the WriteMessage.html
----------------------------------
<html>
<head>
<title>Guestbook</title>
</head>
<body>
<center>Write To ACJavascripts Guestbook</center>
<hr>
<form action="http://www.acjavascripts.com/cgi-bin/Guestbook/WriteMessage2.cgi" method="POST">
<table>
<tr>
<td>
Email </td><td><input type="text" name="Email">
</td></tr><tr><td>
Name </td><td><input type="text" name="Name">
</td></tr><tr><td>
Location </td><td><input type="text" name="Loc">
</td></tr><tr><td>
Message </td><td><textarea name="message" rows=8 cols=60 wrap="virtual">
</textarea>
</td></tr></table>
<input type="submit" value=" - Submit - ">
</form>
</body>
</html>
---------------------------
This is the WriteMessage.cgi
----------------------------
#!/usr/bin/perl
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/,$buffer);
foreach $pair(@pairs){
($name, $value) = split(/=/,$pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][-a-fA-F0-9])/pack("C",hex($1))/eg;
$value =~ s/\n/ /;
$value =~ s/\r//g;
$value =~ s/\cM//g;
$FORM{$name} = $value;
}
$Refresh = "http://www.acjavascripts.com/cgi-bin/Guestbook/Guestbook.cgi";
open(OUTF,">>MessageDatabase.dat");
flock(OUTF,2);
seek(OUTF,0,2);
print OUTF "$FORM{'Email'}|$FORM{'Name'}|$FORM{'Loc'}|$FORM{'message'}\n";
close(OUTF);
print "Content-type:text/html\n\n";
print "<html><head><title>Thank you</title><META HTTP-EQUIV=\"Refresh\" CONTENT=\"2; URL=$Refresh\"></head>\n";
print "<body>\n";
print "<BR><BR><BR><BR><BR><BR><center>\n";
print "<table border=1 borderColor=\"black\">\n";
print "<tr><td bgColor=\"salmon\">\n";
print "<font color=\"black\"><b><center>\n";
print "Thank you for posting your message.<BR>\n";
print "You will be redirected shortly.<BR><BR>\n";
print "<h4>If you browser does not redirected you then click here: <a href=\"$Refresh\">Guestbook</a>\n";
print "</body></html>";
------------------------------
Thats Pretty Much that. lol
I just saw this. Where i have the $value=~ s/\n//g;
is that were i should put the smily replace ??