non-working perl script under Windows 2008

D

dr.mtarver

I'm doing a test Perl script under Windows 2008

Here is the HTML page that calls it; a simple submit button

<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Untitled </title>
</head>

<body>
<form action="cgi-bin/lambdaperl.cgi" method="POST">
</form>

<form method="POST">
<p><input type="submit" name="B1" value="Submit"></p>
</form>
</body>
</html>

Here is the file lambdaperl.cgi

#!/usr/bin/perl

print "HTTP/1.0 200 OK\n";
print "Content-type: text/html\n\n";
print <<HTML;
<html>
<head>
<title>A Simple Perl CGI</title>
</head>
<body>
<h1>A Simple Perl CGI</h1>
<p>Hello World</p>
</body>
<//html>
HTML

exit;

I get

405 - HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
 
J

Janek Schleicher

Am 24.02.2014 13:16, schrieb (e-mail address removed):
I'm doing a test Perl script under Windows 2008

Here is the HTML page that calls it; a simple submit button
...
<body>
<form action="cgi-bin/lambdaperl.cgi" method="POST">

The input-submit buttion has to be inside this form.
</form>

<form method="POST">

This is now a new formular with no action specified what to do when
something is submitted.
<p><input type="submit" name="B1" value="Submit"></p>
</form>
</body>
</html>


Greetings,
Janek
 
J

Jürgen Exner

I'm doing a test Perl script under Windows 2008

Here is the HTML page that calls it; a simple submit button
Irrelevant

Here is the file lambdaperl.cgi
Irrelevant

I get

405 - HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

This is not a Perl error message.

jue
 
J

Janek Schleicher

Am 24.02.2014 21:16, schrieb gamo:
El 24/02/14 13:16, (e-mail address removed) escribió:
^^ this is a error

that every Browser could handle :)


Greetings,
Janek
 
J

Jens Thoms Toerring

I'm doing a test Perl script under Windows 2008
Here is the HTML page that calls it; a simple submit button

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Untitled </title>
</head>
<body>
<form action="cgi-bin/lambdaperl.cgi" method="POST">
</form>
<form method="POST">
<p><input type="submit" name="B1" value="Submit"></p>
</form>
</body>
</html>
Here is the file lambdaperl.cgi
#!/usr/bin/perl

print "HTTP/1.0 200 OK\n";
print "Content-type: text/html\n\n";

Beside what others have told you: these two lines aren't
anything your script is supposed to write out, they are
send by the web server all on it's own before it passes
what your script did output on to the client.

Regards, Jens
 
S

Scott Bryce

Beside what others have told you: these two lines aren't anything
your script is supposed to write out, they are send by the web server
all on it's own before it passes what your script did output on to
the client.

Actually, no. Your script does need to send them. The web server isn't
going to assume it knows what type of content/response you want to send
back to the browser.
 
$

$Bill

Actually, no. Your script does need to send them. The web server isn't
going to assume it knows what type of content/response you want to send
back to the browser.

The second line and blank after are needed, the first line is only needed
for IIS and non-parsed header (NPH) scripts.
 
P

Peter J. Holzer

The second line and blank after are needed, the first line is only needed
for IIS and non-parsed header (NPH) scripts.

For normal CGI scripts you should replace the first line with a Status
header:

print "Status: 200\n";

However, since 200 is the default, you can omit it (and most people do).

hp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top