
no longer fuzzy
Deleted
Aug 10, 2000, 8:45 AM
Post #1 of 7
(323 views)
|
|
Mysterious 500 error
|
Can't Post
|
|
Hi. this is my first time posting here, so I hope this is in the correct forum. I'm getting an internal server error with this script, but I can't seem to spot the problem. I ran perl -cw and didn't find any errors, so I thought it was probably a problem with my form. I set mode 666 on my .dax files and 755 on the script itself, so I don't think it's that. Maybe a fresh set of eyes can spot it, since mine are getting sore from squinting. Here is the form: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">quote:</font><HR> <HTML> <HEAD> </HEAD> <BODY BGCOLOR="000000" TEXT="FF0000"> <CENTER> <TABLE WIDTH=80% BORDER=0> <TR> <TD ALIGN="CENTER" COLSPAN=2> <P><FONT SIZE=+2>Add your link!<BR></FONT></P> </TD> </TR> <TR> <TD COLSPAN=2> <P>I find that trying to keep up with all of the new guilds that keep appearing to be a pain, so I thought I'd just let you add your own link. <BR></P> </TD> </TR> <FORM ACTION="http://absolute.url.here/script.cgi" METHOD="POST"> <TR> <TD ALIGN="CENTER" COLSPAN=2> <P>The name of your site</P> </TD> </TR> <TR> <TD ALIGN="CENTER" COLSPAN=2> <INPUT TYPE="TEXT" NAME="sitename"> </TD> </TR> <TR> <TD ALIGN="CENTER"> <P>The URL of your site</P> </TD> <TD ALIGN="CENTER"> <P>The URL of your banner</P> </TD> </TR> <TR> <TD ALIGN="CENTER"> <INPUT TYPE="TEXT" NAME="siteurl" VALUE="http://"> </TD> <TD ALIGN="CENTER"> <INPUT TYPE="TEXT" NAME="bannerurl" VALUE="http://"> </TD> </TR> <TR> <TD ALIGN="CENTER" COLSPAN=2> <P>A brief description of your site</P> </TD> </TR> <TR> <TD ALIGN="CENTER" COLSPAN=2> <TEXTAREA NAME="description" ROWS=5 COLS=60 WRAP="VIRTUAL"></TEXTAREA> </TD> </TR> <TR> <TD ALIGN="CENTER" COLSPAN=2> <P>Email address of the webmaster</P> </TD> </TR> <TR> <TD ALIGN="CENTER" COLSPAN=2> <INPUT TYPE="TEXT" NAME="email"> </TD> </TR> <TR> <TD ALIGN="CENTER" COLSPAN=2> <INPUT TYPE="SUBMIT" VALUE="Submit"> </TD> </TR> </TABLE> </FORM> </CENTER> </BODY> </HTML><HR></BLOCKQUOTE> and here is the whole script: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">quote:</font><HR> #!/usr/bin/perl print "Content-type:text/html\n\n; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $FORM{$name}=$value; } open(OUTF, ">>links.dax" or dienice ("Could not write to link database: $!\n"); flock(0,2); seek(OUTF,0,2); print OUTF "$FORM{'sitename'}|$FORM{'siteurl'}|$FORM{'bannerurl'}|$FORM{'description'}\n"; close(OUTF); open(EMAILADDY, ">>email.dax" or dienice ("Could not write to email database: !$\n"); flock(0,2); seek(EMAILADDY,0,2); print EMAILADDY "$FORM{'sitename'}|$FORM{'email'}\n"; close(EMAILADDY); print <<EndHead; !html snipped EndHead open (INF, "links.dax") or dienice ("Could not open link database for reading: !$\n"); seek(INF,0,0); @data = <INF>; close (INF); foreach $n (@data) { chomp ($n); ($name,$url,$banner,$desc) = split(/\|/,$n); print "<tr><td align='center'>$name</td></tr>\n"; print "<tr><td align='center'><a href='url'><img src='$banner' border=0 alt='$name'></a></td></tr>\n"; print "<tr><td align='center'>$desc</td></tr>\n"; } print <<EndTail; !html snipped EndTail sub dienice { my($msg) = @_; print "<h2>Error</h2>\n"; print $msg; exit; } <HR></BLOCKQUOTE> [This message has been edited by no longer fuzzy (edited 08-10-2000).]
|