This script is supposed to be a bulliten board. Do you see anything wrong with it? I kepp getting the 500 error. There's two, kinda long. Here's the first one.
#!/usr/bin/perl require "cgi-lib.pl"; require "subroutines.pl"; &ReadParse; print &PrintHeader; $url="http://soccermb.netfirms.com/board/bb.htm"; $bbfile1 = "$ENV{'DOCUMENT_ROOT'}/www/board/box1.htm"; $bbfile2 = "$ENV{'DOCUMENT_ROOT'}/www/board/box2.htm"; $bbfile3 = "$ENV{'DOCUMENT_ROOT'}/www/board/box3.htm"; $bbfile4 = "$ENV{'DOCUMENT_ROOT'}/www/board/box4.htm"; unless (-e $bbfile1) { print <<"PrintTag"; <html><body> <h2>$bbfile1 not present.</h2> <p>Did you upload the file? If so, the server path to your box1.htm file is incorrect in your CGI program. Check with your hosting service to find the server path to your HTML files.</p> </body></html> PrintTag exit(0); } unless (-e $bbfile2) { print <<"PrintTag"; <html><body> <h2>$bbfile2 not present.</h2> <p>Did you upload the file? If so, the server path to your box1.htm file is incorrect in your CGI program. Check with your hosting service to find the server path to your HTML files.</p> </body></html> PrintTag exit(0); } unless (-e $bbfile3) { print <<"PrintTag"; <html><body> <h2>$bbfile3 not present.</h2> <p>Did you upload the file? If so, the server path to your box1.htm file is incorrect in your CGI program. Check with your hosting service to find the server path to your HTML files.</p> </body></html> PrintTag exit(0); } unless (-e $bbfile4) { print <<"PrintTag"; <html><body> <h2>$bbfile4 not present.</h2> <p>Did you upload the file? If so, the server path to your box1.htm file is incorrect in your CGI program. Check with your hosting service to find the server path to your HTML files.</p> </body></html> PrintTag exit(0); } $tempfile1="$ENV{'DOCUMENT_ROOT'}/www/board/bbtemp1.htm"; $tempfile2="$ENV{'DOCUMENT_ROOT'}/www/board/bbtemp2.htm"; $tempfile3="$ENV{'DOCUMENT_ROOT'}/www/board/bbtemp3.htm"; $tempfile4="$ENV{'DOCUMENT_ROOT'}/www/board/bbtemp4.htm"; if (($in{'visitor_name'} eq "") || ($in{'visitor_email_address'} eq "" +) || ($in{'radioset'} eq "") || ($in{'Comment'} eq "")) { print <<"PrintTag"; <html><body> <h2>Data Incomplete</h2> <p>Your request to send comments to the board has been rejected due to insufficient information. To properly send your comments, please fill out:</p> <ul> PrintTag if ($in{'visitor_name'} eq "") { print "\n<li> Your Name\n"; } if ($in{'visitor_email_address'} eq "") { print "\n<li> Your Email Address\n"; } if ($in{'radioset'} eq "") { print "\n<li> Your county\n"; } if ($in{'Comment'} eq "") { print "\n<li> Your comments\n"; } print "</ul>\n</p>\n</body>\n</html>\n"; exit(0); } #STOP HERE FOR NOW if (($in{'Comments'} =~ /damn/) || ($in{'Comments'} =~ /darn/) || ($in{'Comments'} =~ /dang/) || ($in{'Comments'} =~ /shit/) || ($in{'Comments'} =~ /basterd/) || ($in{'Comments'} =~ /fuck/) || ($in{'Comments'} =~ /fuckin'/) || ($in{'Comments'} =~ /fucking/) || ($in{'Comments'} =~ /freak/) || ($in{'Comments'} =~ /freakin'/) || ($in{'Comments'} =~ /freaking/) || ($in{'Comments'} =~ /bitch/) || ($in{'Comments'} =~ /bitchin'/) || ($in{'Comments'} =~ /bitching/)) { print<<"PrintTag"; <html><body> <h2>Request denied-improper language.</h2> </body></html> PrintTag exit(0); } $in{'visitor_name'} =~ s/\</&lt;/g; $in{'visitor_name'} =~ s/\>/&gt;/g; $in{'visitor_email_address'} =~ s/\</&lt;/g; $in{'visitor_email_address'} =~ s/\>/&gt;/g; $in{'Comment'} =~ s/\</&lt;/g; $in{'Comment'} =~ s/\>/&gt;/g; if (-e "lock.fil") { print <<"PrintTag"; <HTML> <BODY> <H2>Try again!</H2> <p> The bulletin board is in use. Please try again later. </p> </BODY> </HTML> PrintTag exit(0); } open(LOCKFILE, ">lock.fil"); #Start subroutines if ($in{'radioset'} eq "Kern" || "San Luis Obispo" || "Santa Barbara") { &box1 } if ($in{'radioset'} eq "Riverside" || "San Diego" || "Imperial") { &box4 } if ($in{'radioset'} eq "Orange" || "San Bernadino") { &box3 } if ($in{'radioset'} eq "Ventura" || "Los Angeles") { &box2 } #open(BBFILE,"$bbfile") || die "Can't find bulletin board.\n"; #@indata = <BBFILE>; #close(BBFILE); #open(TEMPFILE,">$tempfile") || die "Can't find temp file.\n"; #foreach $i (@indata) #{ #chop($i); #print TEMPFILE "$i\n"; #if ($i =~ /<!-- BEGINNING -->/i) #{ #print TEMPFILE "<p><a href=\"mailto:$in{'email'}\">"; #print TEMPFILE "$in{'name'}"; #print TEMPFILE "</a>"; #print TEMPFILE "<br>"; #print TEMPFILE "$in{'comments'}</p><hr>\n\n"; #} #} #refresh bulletin board #close(TEMPFILE); #rename("$bbfile", "$bbfile.old"); #rename("$tempfile", "$bbfile"); #close(LOCKFILE); #unlink("lock.fil"); #Thank you page #print <<"PrintTag"; #<html><body> #<h2>Bulletin Board Entry Accepted</h2> #<p>View <A HREF="$url">Bulletin Board</A></p> #</body></html> #PrintTag

Edit Masem 2001-12-19 - Edited title from "HELP" to fix searching problems


In reply to Bulletin Board Script Trouble by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.