non-working perl script under Windows 2008

Discussion in 'Perl Misc' started by dr.mtarver@gmail.com, Feb 24, 2014.

  1. Guest

    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.
     
    , Feb 24, 2014
    #1
    1. Advertising

  2. Am 24.02.2014 13:16, schrieb :
    > 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
     
    Janek Schleicher, Feb 24, 2014
    #2
    1. Advertising

  3. wrote:
    >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ürgen Exner, Feb 24, 2014
    #3
  4. gamo Guest

    gamo, Feb 24, 2014
    #4
  5. Am 24.02.2014 21:16, schrieb gamo:
    > El 24/02/14 13:16, escribió:
    >> <p>Hello World</p>
    >> </body>
    >> <//html>

    > ^^ this is a error


    that every Browser could handle :)


    Greetings,
    Janek
     
    Janek Schleicher, Feb 24, 2014
    #5
  6. wrote:
    > 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";


    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
    --
    \ Jens Thoms Toerring ___
    \__________________________ http://toerring.de
     
    Jens Thoms Toerring, Feb 25, 2014
    #6
  7. Scott Bryce Guest

    On 2/24/2014 5:47 PM, Jens Thoms Toerring wrote:
    > wrote:
    >> 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.


    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.
     
    Scott Bryce, Feb 25, 2014
    #7
  8. $Bill Guest

    On 2/24/2014 21:49, Scott Bryce wrote:
    > On 2/24/2014 5:47 PM, Jens Thoms Toerring wrote:
    >> wrote:
    >>> 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.

    >
    > 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.
     
    $Bill, Feb 25, 2014
    #8
  9. On 2014-02-25 11:55, $Bill <> wrote:
    > On 2/24/2014 21:49, Scott Bryce wrote:
    >> On 2/24/2014 5:47 PM, Jens Thoms Toerring wrote:
    >>> wrote:
    >>>> 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.

    >>
    >> 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.


    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


    --
    _ | Peter J. Holzer | Fluch der elektronischen Textverarbeitung:
    |_|_) | | Man feilt solange an seinen Text um, bis
    | | | | die Satzbestandteile des Satzes nicht mehr
    __/ | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel
     
    Peter J. Holzer, Feb 25, 2014
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,824
  2. shapper

    Windows 2008 and SQL 2008

    shapper, Dec 8, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    353
    Mark Fitzpatrick
    Dec 8, 2007
  3. Julien
    Replies:
    1
    Views:
    2,086
    Cowboy \(Gregory A. Beamer\)
    May 18, 2009
  4. HolgerEb1

    CreateDC on Windows 2008 X64 under IIS

    HolgerEb1, Jan 20, 2009, in forum: ASP General
    Replies:
    1
    Views:
    414
    Bob Barrows
    Jan 20, 2009
  5. kath
    Replies:
    4
    Views:
    672
    J. Gleixner
    Apr 9, 2007
Loading...

Share This Page