Apache question

Discussion in 'Javascript' started by joe, Jun 9, 2006.

  1. joe

    joe Guest

    I am learning Javascript by running Apache on my computer. The following question
    does not have Javascript because I've stripped it from a larger project.

    I have the following simple index.html:

    <html>
    <p>Test</p>
    <p>
    <form action="http://127.0.0.1/test.pl" method="POST">
    <input type="text" name="textfield" value="Hi!">
    <input type="submit" name="Submit" value="Submit">
    </form>
    </html>

    and the test.pl Perl file is even simpler:

    #!/usr/bin/perl
    open COLOURS, ">colours.txt";
    print COLOURS "My favourite colour is blue\n";
    close COLOURS;

    When I open the IE and go to http://127.0.0.1 I get the test form above. But
    when I press the Submit button I get Save/Open dialog instead of colours.txt
    being created.

    I have set up a Perl interpreter. When I run "perl test.pl" from DOS command
    prompt I get what I expect.

    What gives?
    joe, Jun 9, 2006
    #1
    1. Advertising

  2. joe schreef:
    > I have set up a Perl interpreter. When I run "perl test.pl" from DOS command
    > prompt I get what I expect.
    >


    You will also have to add a Perl script handler to the httpd.conf for
    the script to be correclty interpreted.

    You should consult the web or one of the many Apache-related newsgroups
    for further guidance, as this problem has nothing to do with JavaScript.


    JW
    Janwillem Borleffs, Jun 9, 2006
    #2
    1. Advertising

  3. joe

    Robert Guest

    Re: [OT] Apache question

    joe wrote:
    > I am learning Javascript by running Apache on my computer. The following question
    > does not have Javascript because I've stripped it from a larger project.


    Okay... so you are learning javascript from an example that contains no
    javascript? And then you ask in a javascript group why your example
    devoid of any javascript does not do what you want? Does that not sound
    silly to you?

    I have no knowledge of Perl or of the Apache webserver, but if I would
    have to take a guess it is that an incorrect mime-type is returned for
    the text file in your http header.

    This answer did not contain any javascript either...

    Robert.
    Robert, Jun 9, 2006
    #3
    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.

Share This Page