-
web server error
i am trying to run a cgi perl script to process info from a html form and i keep getting
WEB SERVER ERROR: the resource that you tried to reach: [pathname], caused a program to run, which did not execute as intended.
i have checked my permissions and my syntax umpteen times, as well as my pathname and filename. i know it's a long shot, but if anyone has any ideas as to where i might look for an error, you just might save an otherwise nice girl with a promising future from going to the crazy house...
-
Could you post the code, that'll make it a bit easier...
-
If you can, look in the server's error log. Otherwise try posting in the Perl forum:
http://www.sitepointforums.com/forum...php?forumid=36
Sean :)
-
the server's error log says "no such file or directory, execution failed"; but i know that the filename and pathnames are both right.
Here's my script (even though i am pretty sure there's nothing wrong with it, that's why i didn't write to the perl forum in the 1st place):
#!usr/bin/perl
#
#
#
#CGI written to create on-the-fly station home page from home_page.html form
#written 10/30/01 by sadie morse, USGS WRD skmorse@usgs.gov
#
#######
print "Content-type:text/html\n\n";
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/ /g; # replace newlines with spaces
$value =~ s/\r//g; # remove hard returns
$value =~ s/\cM//g; # delete ^M's
$FORM{$name} = $value;
}
#this hash takes the data from the "name" form element and converts it back to
#the name of the gaging stations
%name = ( $FORM{'noselect'} => "",
$FORM{'roosevelt'} => "Big Cr nr Roosevelt Beach",
$FORM{'siletz'} => "Siletz nr Siletz, OR",
$FORM{'beaver'} => "Nestucca R nr Beaver, OR",
$FORM{'fairdale2'} =>" Nestucca R nr Fairdale",
$FORM{'tillamook'} => "Wilson R nr Tillamook" );
#here is the returned page
print <<HTML;
<html><head><title>$FORM{'name'}</title></head>
<body bgcolor=\"#cccc99\" text=\"#003300\" vlink=\"#dd9911\" link=\"#0033aa\">
<H3 Align=center>$FORM{'name'}</H3>
<P>this is the gaging station from which you will be requesting information</body></html>
HTML
-
daft question but does your server have perl support? You might want to check on that first as it sounds like its not recognised?