<div>I am getting the following error message when I call or execute a cgi script from another website.</div> <div> </div> <div>HTTP Error 405.0 - Method Not Allowed</div> <div>
print "Content-type: text/html\n\n";
print "<html><body><br></body></html>\n";
print "Starting";
# Parse the input
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
} else {
$buffer = $ENV{'QUERY_STRING'};
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$PARAM{$name}=$value;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
# Write the logfile
open(LOG,">>call.log");
print LOG "-----------------------------------------------------------------------\n";
foreach $a (keys %FORM) {
print LOG "$a:",$FORM{$a};
print LOG "\n";
}
print "Finished";
close(LOG);</div>
The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
</div> <div>I have attached a screen shot of the error message.</div> <div> </div> <div>http://www.curtainsmadesimple.co.uk/Old/Callback%20Issue.jpg</div> <div> </div> <div>I have edited the "Feature Permissions" in the IIS 7.0 Manager to allow executable and tried changing some of the other permissions in the CGI Module. But no luck.</div> <div> </div> <div>The CGI file (Perl) receives some variables.... orderref, name, address, town, county, postcode, formattedamount, timestamp, streference, stauthcode and uses them in the cgi file to write to a log file call.log</div> <div> </div> <div>The CGI file and log file are in the cgi-bin folder.</div> <div> </div> <div>The CGI file is as follows...</div><div> </div> <div># Read in variables from user's browserprint "Content-type: text/html\n\n";
print "<html><body><br></body></html>\n";
print "Starting";
# Parse the input
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
} else {
$buffer = $ENV{'QUERY_STRING'};
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$PARAM{$name}=$value;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
# Write the logfile
open(LOG,">>call.log");
print LOG "-----------------------------------------------------------------------\n";
foreach $a (keys %FORM) {
print LOG "$a:",$FORM{$a};
print LOG "\n";
}
print "Finished";
close(LOG);</div>