how to use one cgi for input and action?

Discussion in 'Perl Misc' started by robertchen117@gmail.com, Feb 12, 2007.

  1. Guest

    hi all,

    I do not want to use a html page with form action point to a perl cgi
    programe, I want to they are in the same page (same cgi).

    For example, my cgi could looks like this:

    Please input the Fahrenheit: 40

    The Celsius is : xx

    After the user input the number, the cgi will caculate the Celsius.
    And also we still have the input editor for input again and again.

    Thanks.
    , Feb 12, 2007
    #1
    1. Advertising

  2. On 02/12/2007 01:53 AM, wrote:
    > hi all,
    >
    > I do not want to use a html page with form action point to a perl cgi
    > programe, I want to they are in the same page (same cgi).
    >
    > For example, my cgi could looks like this:
    >
    > Please input the Fahrenheit: 40
    >
    > The Celsius is : xx
    >
    > After the user input the number, the cgi will caculate the Celsius.
    > And also we still have the input editor for input again and again.
    >
    > Thanks.
    >


    CGI.pm seems to do this by default if you use that module's functions to
    create the form. Check out the first example in the POD for CGI.pm.


    --
    Windows Vista and your freedom in conflict:
    http://www.regdeveloper.co.uk/2006/10/29/microsoft_vista_eula_analysis/
    Mumia W. (NOSPAM), Feb 12, 2007
    #2
    1. Advertising

  3. Ted Zlatanov Guest

    On 11 Feb 2007 23:53:07 -0800 "" <> wrote:

    rc> For example, my cgi could looks like this:

    rc> Please input the Fahrenheit: 40

    rc> The Celsius is : xx

    rc> After the user input the number, the cgi will caculate the Celsius.
    rc> And also we still have the input editor for input again and again.

    As an aside, it always surprised me anyone would think this is useful,
    except as a homework assignment. Here's some suggestions:

    1) if you need to convert C to F in a web browser, use JavaScript.
    It's ideal for this kind of quick calculation. You don't even need
    HTML to do it, just prompt() and alert().

    2) If you must do it as a CGI, at least provide something useful, like
    a visual scale from -50 F to 200 F that shows C temperatures, with the
    user's input as a notch on the scale in addition to the simple
    numerical answer.

    Ted
    Ted Zlatanov, Feb 12, 2007
    #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.
Similar Threads
  1. Joe Bloggs
    Replies:
    1
    Views:
    718
    Sudsy
    Aug 3, 2003
  2. rjweytens
    Replies:
    6
    Views:
    16,046
    rjweytens
    Jun 25, 2004
  3. runescience

    Struts mapping action to action???

    runescience, Feb 6, 2006, in forum: Java
    Replies:
    3
    Views:
    1,805
    runescience
    Feb 7, 2006
  4. LarsenMTL
    Replies:
    4
    Views:
    649
    Eric Walstad
    Nov 4, 2004
  5. Guy
    Replies:
    4
    Views:
    761
    Malcolm Dew-Jones
    Dec 11, 2003
Loading...

Share This Page