Simple stateful web page?

C

carlg

How would I write a simple web app in Perl+cgi that has state? Let's
say I just want to have a web page that has an input field, an Accept
button and a Clear button. Whenever I type some text into the field
and click on Accept it concatenates the text in the field with an
existing string and displays it on the web page. So I can submit a few
words one at a time and make a sentence. Clicking the Clear button
lets me start over.

-Carl Gundel, author of Liberty BASIC
http://www.libertybasic.com
 
D

David Squire

How would I write a simple web app in Perl+cgi that has state? Let's
say I just want to have a web page that has an input field, an Accept
button and a Clear button. Whenever I type some text into the field
and click on Accept it concatenates the text in the field with an
existing string and displays it on the web page. So I can submit a few
words one at a time and make a sentence. Clicking the Clear button
lets me start over.

This is really a CGI programming question, not a Perl question. There
are a number of ways. You could use cookies. You could use hidden input
fields in the form.

If you want to do this in Perl, go to CPAN and check out the CGI.pm
module, and the CGI::Cookie.pm module (amongst others). They make it
easier to do what you want.


DS
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top