how to use one cgi for input and action?

R

robertchen117

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

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.

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

Ted Zlatanov

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
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top