mnlight has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w #Volunteer.pl - Sign up sheet for Volunteers use strict; use DBI; use CGI qw(:standard); use CGI::Pretty; use CGI::Cookie; my $query = CGI::Pretty->new; #my $query = CGI::new; my ($dbh, $sth); my @val= (); my $user = $query->remote_user(); $dbh = DBI->connect ("DBI:mysql:host=localhost;database=<database>", "mnlight","<password>", {PrintError=> 0, RaiseError=> 1}); $sth = $dbh->prepare ("SELECT * FROM Volunteer where Volunteer = 'TBD' +"); $sth->execute (); print header(), start_html ("Volunteer SignUp Form"); print "<body bgcolor=#FFFFF1>"; print "<p><hr><p>"; print "<CENTER>"; print "<TABLE WIDTH='100%'BORDER='1' CELLSPACING='1' CELLPADDING='7'>" +; print "<TR>"; print "<TH bgcolor='#9933FF'><font size='5'color='#FFFFFF'><center><st +rong>MN LIGHTNING 90 SignUp Sheet</font></strong></center> <br><font size='2'color='#FFFFFF'><center>To sign up for a time simply + select the botton indicating if you are the players Mothe r or Father.<br> Then click the TBD link in the Volunteer column and y +our name will appear on the verification form.</font></cen ter></th>"; print "</TR>"; print "</TABLE>"; print $query->start_form('POST','./Signup.pl'); print $query->radio_group( -name =>'Parent', -value =>["Father", "Mother"], -default=>["NO DEFAULT"], -linebreak=>'true', -columnheader=>'Parent'); print $query->end_form(); while (my @val = $sth->fetchrow_array ()) { print "<TR>"; print "<TH WIDTH='10%' VALIGN='TOP' BGCOLOR='#99FF99'>"; print "<FONT SIZE='2' COLOR='#9933FF'>"; # Signup2.pl still needs work... print "<A HREF=./Signup.pl?$user&$val[2]&$val[3]>$val[0]</th>"; print "<TH WIDTH='10%' VALIGN='TOP' BGCOLOR='#99FF99' align='center' +>"; print "<FONT SIZE='2' COLOR='#9933FF'>$val[1]</th>"; print "<TH WIDTH='10%' VALIGN='TOP' BGCOLOR='#99FF99' align='center' +>"; print "<FONT SIZE='2' COLOR='#9933FF'>$val[2]</th>"; print "<TH WIDTH='10%' VALIGN='TOP' BGCOLOR='#99FF99' align='center' +>"; print "<FONT SIZE='2' COLOR='#9933FF'>$val[3]</th>"; print "</TR>"; }
Do I need to pass name from the form to the reference in the table before it gets passed to the script? What is missing?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing a form parm and a url reference to a different script
by TomK32 (Monk) on Dec 23, 2001 at 01:40 UTC | |
by mnlight (Scribe) on Dec 23, 2001 at 11:51 UTC | |
by TomK32 (Monk) on Dec 23, 2001 at 13:21 UTC |