=?ISO-8859-1?Q?Submit_form_doesn=B4t_work.?=

Discussion in 'HTML' started by Mark, Oct 6, 2003.

  1. Mark

    Mark Guest

    The following -very simple- page doesn´t work. What am I overlooking?
    If I press the submit button, IE opens the page react.htm and leaves
    it at that. Why doesn´t the contents of the form go to the react.htm
    page.

    <html>
    <head>
    <title>Guestbook</title>
    </head>
    <body>
    <h1 align=center> Welcome to the guestbook</h1>
    <p> Leave your remarks in the form and press the Submit button</p>
    </body>

    <form name="reactions" action="react.htm" method="post">
    First name:
    <input type="text" name="firstname">
    <br>
    Last name:
    <input type="text" name="lastname">
    <br>
    <textarea rows="10" cols="30">
    Put here your reaction
    </textarea>
    <br>
    <input type="submit" value="submit">
    </form>

    </html>
     
    Mark, Oct 6, 2003
    #1
    1. Advertising

  2. Re: Submit form doesn´t work.

    Mark wrote:
    > The following -very simple- page doesn´t work. What am I overlooking?
    > If I press the submit button, IE opens the page react.htm and leaves
    > it at that. Why doesn´t the contents of the form go to the react.htm
    > page.
    >


    it does - how are you handling the data at react.htm?

    ..htm files are not (usually) server side scripts

    --
    William Tasso - http://WilliamTasso.com
     
    William Tasso, Oct 6, 2003
    #2
    1. Advertising

  3. Re: Submit form =?iso-8859-1?Q?doesn=B4t?= work.

    Mark wrote:
    >
    > The following -very simple- page doesn´t work. What am I overlooking?
    > If I press the submit button, IE opens the page react.htm and leaves
    > it at that. Why doesn´t the contents of the form go to the react.htm
    > page.
    >
    > <html>
    > <head>
    > <title>Guestbook</title>
    > </head>
    > <body>
    > <h1 align=center> Welcome to the guestbook</h1>
    > <p> Leave your remarks in the form and press the Submit button</p>
    > </body>
    >
    > <form name="reactions" action="react.htm" method="post">

    Here's the problem!
    you're posting to an html file.
    you'll want to send it to a handler like a perl script or some other
    CGI.
    you're not limited to CGI though. depending on the server, you can also
    try ASP or PHP.
    well here's a popular one:
    http://www.scriptarchive.com/guestbook.html
    then, you're going to want to post to some perl newsgroup.
    I know plenty of perl newsgroups, but I can't think of a beginer
    friendly perl newsgroup. maybe someone else can suggest.

    you can try this VERY BASIC perl script to handle your form:
    first change your file name from react.htm to react.cgi
    and add name="comments" to your textarea tag.
    now create the file react.cgi and copy and paste this in:

    #!/usr/bin/perl -w
    use strict;
    use warnings;
    use CGI qw(param);
    my($first)=param('firstname');
    my($last)=param('lastname');
    my($comments)=param('comments');
    open (WRITE, ">>guestbook.txt");
    print WRITE "$first $last <br>\n";
    print WRITE "$comments<hr>\n";
    close (WRITE);

    like I said, very basic.

    > First name:
    > <input type="text" name="firstname">
    > <br>
    > Last name:
    > <input type="text" name="lastname">
    > <br>
    > <textarea rows="10" cols="30">
    > Put here your reaction
    > </textarea>
    > <br>
    > <input type="submit" value="submit">
    > </form>
    >
    > </html>
     
    Ben Dover - Mental Patient 0057, Oct 6, 2003
    #3
  4. Mark

    Mark Guest

    William,

    Thank you for your response.
    I guess the thing I was overlooking was... that I am very VERY new at
    this and don´t have a clue about server-side scripts.

    Is this the only way to handle this?
    Where can I find more info on this subject. What should I look for?

    thanks for your help!

    Mark


    "William Tasso" <> wrote in message news:<blrc89$fh1n4$-berlin.de>...
    > Mark wrote:
    > > The following -very simple- page doesn´t work. What am I overlooking?
    > > If I press the submit button, IE opens the page react.htm and leaves
    > > it at that. Why doesn´t the contents of the form go to the react.htm
    > > page.
    > >

    >
    > it does - how are you handling the data at react.htm?
    >
    > .htm files are not (usually) server side scripts
     
    Mark, Oct 6, 2003
    #4
  5. Re: Submit form doesn´t work.

    Mark wrote:
    > "William Tasso" <> wrote in message
    > news:<blrc89$fh1n4$-berlin.de>...
    >> Mark wrote:
    >>> The following -very simple- page doesn´t work. What am I
    >>> overlooking? If I press the submit button, IE opens the page
    >>> react.htm and leaves it at that. Why doesn´t the contents of the
    >>> form go to the react.htm page.
    >>>

    >>
    >> it does - how are you handling the data at react.htm?
    >>
    >> .htm files are not (usually) server side scripts


    > I guess the thing I was overlooking was... that I am very VERY new at
    > this and don´t have a clue about server-side scripts.
    >
    > Is this the only way to handle this?
    > Where can I find more info on this subject.


    Jukka Korpella has made a fine page here:
    http://www.cs.tut.fi/~jkorpela/forms/

    > What should I look for?


    forms handling and server side scripting. what scripting dfacilities are
    available on your server?

    Note: it is customary to post replies after the text you are replying to -
    please don't top post.
    --
    William Tasso - http://WilliamTasso.com
     
    William Tasso, Oct 6, 2003
    #5
  6. Re: Submit form =?ISO-8859-1?Q?doesn=B4t_work=2E?=

    Mark wrote:

    > I guess the thing I was overlooking was... that I am very VERY new at
    > this and don´t have a clue about server-side scripts.


    What were you *expecting* the destination page to do with your form data?

    --
    == Dan ==
    Dan's Mail Format Site: http://mailformat.dan.info/
    Dan's Web Tips: http://webtips.dan.info/
    Dan's Domain Site: http://domains.dan.info/
     
    Daniel R. Tobias, Oct 6, 2003
    #6
  7. Mark

    Isofarro Guest

    Re: Submit form =?ISO-8859-1?Q?doesn=B4t?= work.

    Ben Dover - Mental Patient 0057 wrote:

    > Mark wrote:
    >>
    >> The following -very simple- page doesn´t work. What am I overlooking?
    >> If I press the submit button, IE opens the page react.htm and leaves
    >> it at that. Why doesn´t the contents of the form go to the react.htm
    >> page.
    >> <form name="reactions" action="react.htm" method="post">

    > Here's the problem!
    > you're posting to an html file.


    No, he is posting to a URL that ends in an extension .htm. This _could_ be a
    static html file, but there's _nothing_ mandating it. It can easily be an
    URL that resolves to a server-side script. That's not where the "problem"
    lies.

    > you'll want to send it to a handler like a perl script or some other
    > CGI.


    Correct. The URL supplied may be a perl script - and probably is, but the
    URL is really a red herring.


    The page is doing exactly as specified. It is sending the form contents as
    part of the HTTP Entity body (because the method is POST), ready to be
    extracted by the server-side script.


    --
    Iso.
    FAQs: http://html-faq.com http://alt-html.org http://allmyfaqs.com/
    Recommended Hosting: http://www.affordablehost.com/
    Web Design Tutorial: http://www.sitepoint.com/article/1010
     
    Isofarro, Oct 6, 2003
    #7
  8. Mark

    Micah Cowan Guest

    Re: Submit form =?iso-8859-1?q?doesn=B4t?= work.

    (Mark) writes:

    > The following -very simple- page doesn´t work. What am I overlooking?
    > If I press the submit button, IE opens the page react.htm and leaves
    > it at that. Why doesn´t the contents of the form go to the react.htm
    > page.
    >
    > <html>
    > <head>
    > <title>Guestbook</title>
    > </head>
    > <body>
    > <h1 align=center> Welcome to the guestbook</h1>
    > <p> Leave your remarks in the form and press the Submit button</p>
    > </body>
    >
    > <form name="reactions" action="react.htm" method="post">
    > First name:
    > <input type="text" name="firstname">
    > <br>
    > Last name:
    > <input type="text" name="lastname">
    > <br>
    > <textarea rows="10" cols="30">
    > Put here your reaction
    > </textarea>
    > <br>
    > <input type="submit" value="submit">
    > </form>
    >
    > </html>


    Other people have pointed out why the above doesn't work. I'd
    like to additionally point out that your ending </body> tag
    should go after </form>. The above is not valid HTML (though I
    doubt any browsers will fail to process it as you expect).

    -Micah
     
    Micah Cowan, Oct 6, 2003
    #8
  9. Re: Submit form =?iso-8859-1?Q?doesn=B4t?= work.

    In article <-Hospital.com>,
    -Hospital.com says...
    >
    >
    > Mark wrote:
    > >
    > > The following -very simple- page doesn´t work. What am I overlooking?
    > > If I press the submit button, IE opens the page react.htm and leaves
    > > it at that. Why doesn´t the contents of the form go to the react.htm
    > > page.
    > >
    > > <html>
    > > <head>
    > > <title>Guestbook</title>
    > > </head>
    > > <body>
    > > <h1 align=center> Welcome to the guestbook</h1>
    > > <p> Leave your remarks in the form and press the Submit button</p>
    > > </body>
    > >
    > > <form name="reactions" action="react.htm" method="post">

    > Here's the problem!
    > you're posting to an html file.


    So? What's an "HTML file"? Is this one:

    <?
    echo "Hellow World!";
    ?>

    --
    Hywel I do not eat quiche
    http://hyweljenkins.co.uk/
    http://hyweljenkins.co.uk/mfaq.php
     
    Hywel Jenkins, Oct 6, 2003
    #9
  10. Mark

    Jordge W. L. Guest

    Re: Submit form =?iso-8859-1?Q?doesn=B4t?= work.

    Isofarro wrote:
    >
    > Ben Dover - Mental Patient 0057 wrote:
    >
    > > Mark wrote:
    > >>



    > No, he is posting to a URL that ends in an extension .htm. This _could_ be a
    > static html file, but there's _nothing_ mandating it. It can easily be an
    > URL that resolves to a server-side script. That's not where the "problem"
    > lies.


    why would you parse a .htm file? shouldn't it be .shtml or something?

    >
    > > you'll want to send it to a handler like a perl script or some other
    > > CGI.

    >
    > Correct. The URL supplied may be a perl script - and probably is, but the
    > URL is really a red herring.
    >
     
    Jordge W. L., Oct 7, 2003
    #10
  11. Re: Submit form =?iso-8859-1?q?doesn=B4t?= work.

    Jordge W. L. wrote:

    > Isofarro wrote:
    >
    >> No, he is posting to a URL that ends in an extension .htm. This _could_ be a
    >> static html file, but there's _nothing_ mandating it. It can easily be an
    >> URL that resolves to a server-side script. That's not where the "problem"
    >> lies.

    >
    > why would you parse a .htm file? shouldn't it be .shtml or something?


    Extensions are meaningless on the WWW.

    See:
    http://www.goddamn.co.uk/tobyink/scratch/extensions/

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
     
    Toby A Inkster, Oct 7, 2003
    #11
  12. Mark

    Isofarro Guest

    Re: Submit form =?ISO-8859-1?Q?doesn=B4t?= work.

    Jordge W. L. wrote:

    >
    >
    > Isofarro wrote:
    >>
    >> Ben Dover - Mental Patient 0057 wrote:
    >>
    >> > Mark wrote:
    >> >>

    >
    >
    >> No, he is posting to a URL that ends in an extension .htm. This _could_
    >> be a static html file, but there's _nothing_ mandating it. It can easily
    >> be an URL that resolves to a server-side script. That's not where the
    >> "problem" lies.

    >
    > why would you parse a .htm file? shouldn't it be .shtml or something?


    No. file extensions are red herrings in URLs. Always have been, always will
    be. URLs point to resources, not files. A resource can be a file or it can
    be the resulting output of a process. An extension doesn't determine which
    of these the resource will be.


    --
    Iso.
    FAQs: http://html-faq.com http://alt-html.org http://allmyfaqs.com/
    Recommended Hosting: http://www.affordablehost.com/
    Web Design Tutorial: http://www.sitepoint.com/article/1010
     
    Isofarro, Oct 7, 2003
    #12
  13. Mark

    Isofarro Guest

    Isofarro, Oct 7, 2003
    #13
  14. Re: Submit form =?iso-8859-1?q?doesn=B4t?= work.

    Isofarro wrote:

    > Toby A Inkster wrote:
    >
    >> Extensions are meaningless on the WWW.
    >>
    >> See:
    >> http://www.goddamn.co.uk/tobyink/scratch/extensions/

    >
    > Good demo. You may want to stick a covering page in there explaining what is
    > going on.


    I shan't bother. My 'scratch' directory is only for short-lived examples.
    They will probably be deleted within weeks.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
     
    Toby A Inkster, Oct 7, 2003
    #14
    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. =?iso-8859-1?b?Sulq6Q==?=

    [EXCEL] sequential =?iso-8859-1?q?acc=E8s=2E?=

    =?iso-8859-1?b?Sulq6Q==?=, Jan 23, 2004, in forum: Perl
    Replies:
    0
    Views:
    736
    =?iso-8859-1?b?Sulq6Q==?=
    Jan 23, 2004
  2. Timiun
    Replies:
    1
    Views:
    539
    Joerg Jooss
    Dec 24, 2003
  3. Navanith

    UTF-8 & ISO-8859-1

    Navanith, Jan 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    392
    Fred Chateau
    Jan 5, 2004
  4. Franck DARRAS
    Replies:
    12
    Views:
    668
    Jim Higson
    Aug 23, 2004
  5. Peter Jacobi
    Replies:
    13
    Views:
    877
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Aug 3, 2004
Loading...

Share This Page