|
Hi everyone
I'm running Abyss web server (www.aprelium.com), and I've installed
activestate activeperl 5.6.
My pages are on http://localhost/test :
gbookf~1.htm:
<HTML>
<HEAD> <TITLE>Fancy Guest Book Page</TITLE> </HEAD> <BODY> <BODY BGCOLOR="#AAAAAA"> <CENTER> <form action="" method="post"> <TABLE BORDER=10 CELLSPACING=10 CELLPADDING=2> <TR> <TH COLSPAN=2 ALIGN=CENTER>GuestBook<BR></TH> </TR> <TR> <TD><B>Name:</B></TD> <TD><input name="name" size=30 maxlength=60><BR></TD> </TR> <TR> <TD><B>Email:</B></TD> <TD><input name="email" size=30 maxlength=60><BR></TD> </TR> <TR> <TD><B>Homepage:</B></TD> <TD><input name="homepage" value="http://" size=30 maxlength=60><BR></TD> </TR> <TR> <TD><B>Your Homepage's Title:</B></TD> <TD><input name="hometitle" size=30 maxlength=60><BR></TD> </TR> <TR> <TD><B>How did you find me?:</B></TD> <TD> <SELECT NAME="reference"> <OPTION>ListServe <OPTION>Student <OPTION>Search Engine <OPTION>NewsGroup <OPTION>Word of Mouth <OPTION>Advertisment/Brochure <OPTION>Personal Friend <OPTION selected>Just Surfed On In!</SELECT><BR></TD> </TR> <TR> <TD COLSPAN=2> <B>COMMENTS:</B><BR> <TEXTAREA WRAP=VIRTUAL NAME="comments" COLS=50 ROWS=8></textarea><BR></TD> </TR> <TR> <TD ALIGN=CENTER> <input type="submit" value="Sign GuestBook"></TD> <TD ALIGN=CENTER> <input type="reset" value="Clear"></TD> </TR> </TABLE> </form> <BR> <A HREF="">| View GuestBook |</A> </CENTER> </BODY> </HTML> gbookf~1.pl:
#!/usr/local/bin/perl
require "cgi-lib.pl";
&ReadParse(*in);
&PrintHeader; #######
# Init ####### $thismonth = (January, February, March, April, May, June, July, August, September, October, November, December)[(localtime)[4]]; $thisday = (localtime)[3]; $thisyear = (localtime)[5]; $myname = "Kenneth
Murphy";
$myemail = "[EMAIL PROTECTED]"; $subject = "New Guestbook Signature"; $sendmail = "/usr/lib/sendmail -t -oi -n"; $test = $in{'test'}; $name = $in{'name'}; $email = $in{'email'}; $homepage = $in{'homepage'}; $hometitle = $in{'hometitle'}; $reference = $in{'reference'}; $comments = $in{'comments'}; $outputfile = "/showme/bchemkm/www/gbookfancy.html"; $outputstore = "/showme/bchemkm/www/gbooksave.html"; $redopage = "/showme/bchemkm/www/redopage.html"; $thankyoupage = "/showme/bchemkm/www/thankyoupage.html"; ####### if ($name eq "" || $comments eq "") {
&redo; exit; } if ($test eq "makesure")
{
&addbook; &writefile; &mailme; exit; } &makesure;
sub mailme {
open (MAIL,"|$sendmail") || die "<HTML><BODY>Failed in opening sendmail</BODY></HTML>\n"; print MAIL <<SOM; To: $myname <$myemail> From: $name <$email> Subject: $subject $name has signed the guestbook. Homepage: $hometitle Location: $homepage E-mail: mailto:$email Reference: $reference Date: $thismonth $thisday, 19$thisyear Comments: $comments SOM } sub redo {
open(REDOPAGE,$redopage) || die "cannot open $redopage for reading"; while (<REDOPAGE>) { print $_; } close(REDOPAGE); } sub addbook
{
open(THANKYOUPAGE,$thankyoupage) || die "cannot open $thankyoupage for reading"; while (<THANKYOUPAGE>) { print $_; } close(THANKYOUPAGE); } sub makesure {
print <<OUTPUT; <HTML> <HEAD> <TITLE>Guest Book Checking Page</TITLE> </HEAD> <BODY> <BODY BGCOLOR="#AAAAAA"> <CENTER> <H2>Hello $name !</H2> Please make sure the following is correct.<P> If you find you need to make a change,<BR> use the back feature on your browser to return to the original form.<P> </CENTER> <HR> <TABLE BORDER=0> <TR> <TD WIDTH=80 NOWRAP><BR></TD> <TD><B>Name: </B>$name<BR> <B>Homepage: </B><A HREF=""> <B>E-mail: </B><A HREF="" href='mailto:$email\">$email mailto:$email\">$email</A><BR> <B>Referred By: </B>$reference<BR> <B>Submitted: </B><I>$thismonth $thisday, 19$thisyear</I><BR> <B>Comments: </B>$comments </TD> </TR> </TABLE> <CENTER> <form action=""http://www.missouri.edu/bchemkm-bin/gbookfancy.pl">http://www.missouri.edu/bchemkm-bin/gbookfancy.pl" method="POST"> <input type="hidden" name="test" value="makesure"> <input type="hidden" name="name" value="$name"> <input type="hidden" name="email" value="$email"> <input type="hidden" name="homepage" value="$homepage"> <input type="hidden" name="hometitle" value="$hometitle"> <input type="hidden" NAME="reference" value="$reference"> <input type="hidden" NAME="comments" value="$comments"> <HR> <TABLE CELLSPACING=10 CELLPADDING=2 BORDER=5> <TR> <TD><input type="submit" value="Sign GuestBook"></TD> </TR> </TABLE> </FORM> </CENTER> <HR> </BODY> </HTML> OUTPUT } sub writefile
{
open(STOREFILE,">$outputstore") || die "cannot create $outputstore"; open(OLDFILE,$outputfile) || die "cannot open $outputfile for reading"; while (<OLDFILE>)
{
print STOREFILE $_; } close(OLDFILE);
close(STOREFILE); open(NEWFILE,">$outputfile") || die "cannot create $outputfile"; print NEWFILE<<stuff; <HTML> <HEAD> <TITLE>The Fancy Guestbook</TITLE> </HEAD> <BODY BACKGROUND=""http://www.missouri.edu/~bchemkm/greybar.gif">Http://www.missouri.edu/~bchemkm/greybar.gif"> <CENTER><H2>Guestbook</H2> </CENTER> <HR> <TABLE BORDER=0> <TR> <TD WIDTH=80 NOWRAP><BR></TD> <TD><B>Name: </B>$name<BR> <B>Homepage: </B><A HREF="" <B>E-mail:</B><A HREF="" href='mailto:$email\">$email mailto:$email\">$email</A><BR> <B>Referred By: </B>$reference<BR> <B>Submitted: </B><I>$thismonth $thisday, 19$thisyear</I><BR> <B>Comments: </B>$comments </TD> </TR> </TABLE> stuff open(SAVEFILE,$outputstore) || die "cannot
open $outputstore for reading";
$num = 0;
while (<SAVEFILE>) { if ($num >= 7) { print NEWFILE $_; } ++$num; } close(SAVEFILE); close(NEWFILE); unlink($outputstore); } The other files are also available, but these are
the most important.
when I submit the form, I see the error 500(The page cannot be displayed), I hope you can help
me.
vincent
|
