Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a three staged database. I take input from page 2, pass it to a database and then grab the information from the database back to the page 1. However, I am unable to get the specified text back to page 1. The text needs to be extracted and input into a text field. Any idea?

2001-03-12 Edit by Corion: Changed title

  • Comment on How to get CGI input parameters (was: question for the monks)

Replies are listed 'Best First'.
Re: question for the monks
by aardvark (Pilgrim) on Mar 12, 2001 at 02:20 UTC
    It's hard to tell exactly what you have going on without some sample code. But it sounds like you want to use CGI parameters to pass around some info. Here is some info on using parameters
    in page 2 form: <form action="page_1.cgi" method="post"> <input type="hidden" name="info" value="$info_from_database">
    in page 1:
    my $info = $cgi->param('info')
    Then in you can test and see if there is any data in the $info parameter and print it.
    If you want it in a textfield then try this: <input type="text" name="textfield_1" value="$info">
    You may also want to consider using a dispatch table as outlined by chipmonk here or by japhy here. A dispatch table gives a 'cleaner' way to program multi-page CGI scripts. Good Luck.

    Get Strong Together!!

Re: question for the monks
by Chady (Priest) on Mar 12, 2001 at 01:17 UTC

    I suggest that you try to find a way to take the specified text back to page 1.

    Sorry for the sarcastic tone, but maybe a little more detail would help... a piece of code maybe??


    Chady | http://chady.net/