Hi, Shane, You should write a first html page with a form that use an action to a script, like this:
<html> <head> <title>Página Teste</title> <body> <form action="../scripts/test.pl" action="post"> <input .... > <input ... > <input type="submit" value="Process" name="process"> <input type="submit" value="Final" name="final"> </form> <body> </html> The script "../scripts/test.pl" may have a content like this: print "HTTP/1.0 200 OK\n"; print "Content-Type: text/html\n\n"; print '<HTML>'; print '<HEAD>'; print '<TITLE>Processed</TITLE>'; print '</HEAD>'; print '<BODY>'; .... your business logic must be coded here, with some output .... if the user click on final button, the output should be produced by the final fase that you have planned .... use the following piece of code to separate the input fields sent by the form @my_query_string = split(/&/,$ENV{'QUERY_STRING'}); foreach $index (0..$my_query_string){ @col = split /=/, $my_query_string[$index]; print 'Field: ', $col[0], ' Value=', $col[1], '<br>'; } print '</BODY>'; print '</HTML>'; I hope it helps you. Josimar ----- Original Message ----- From: "Shane Laffin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 17, 2002 1:01 AM Subject: generating a new web page > Hello All, > > This is my first web perl program. > > I want the user to select an option from a drop down menu, then click > submit. > The program should then go to a new web page to display the results. > > The below code displays all the info on the one page, how do I move to new > web pages. > > I want to build the program up so that each new web page gathers more and > more info from > the user, then culminates in a final page that emulates the users > selections. > > Any suggestions or pointers would be great. > > shane. > > > #!perl.exe > > require DBI; > use CGI; > use strict; > > my $dbh = DBI->connect("DBI:mysql:database=golf;host=localhost"); > my $current_time = localtime; > > my $query = new CGI; > > > &select_tournament(); > &show_result(); > > sub select_tournament { > print $query->header; > > print "<HTML>\n<HEAD>\n<TITLE>GOLF Inc</TITLE>\n</HEAD>\n<BODY>\n"; > > print "<H1 COLOR=BLUE->Golfer Score Board</H1>\n"; > print "<FORM>\n"; > > print "Current Tournaments\n"; > > my $sth = $dbh->prepare('SELECT cname, id FROM tournament'); > $sth->execute(); > my $row; > > print "<SELECT NAME='tourn' SIZE=1>\n"; > while ($row = $sth->fetchrow_arrayref()) { > print "<option value='$$row[0]'>$$row[0]</option>\n"; > } > print "</select>"; > > print "<P>\n"; > print "<INPUT TYPE='submit'>\n"; > print "</P>\n"; > print "</FORM>\n"; > print "</BODY>\n</HTML>\n"; > > # Disconnect from the database. > $dbh->disconnect(); > } > > sub show_result { > > my $query = new CGI; > > print "<HTML>\n<HEAD>\n<TITLE>GOLF Inc 2</TITLE>\n</HEAD>\n<BODY>\n"; > print "<FORM>\n"; > print "<HR>\n"; > print "<H1 COLOR=BLUE->Golf Tournament:</H1>\n"; > > print "<b>Selection:</b> " . $query->param('tourn') . "<br>\n"; > > print "</FORM>\n"; > print "</BODY>\n</HTML>\n"; > > print "<HR>\n"; > } > > > Thanks, > shane.. > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]