In this seventh slide, we introduce the CGI program processing the select form.
The CGI/Perl program gets the value selected, using:
$val=$query->param('link');
then we use the redirect method to display the new page:
$redir= $query->redirect($val);
we finally use the print statement to activate the redirection
print $redir;
1. THE CGI PROGRAM:
#!/usr/local/bin/perl
use CGI;
$query=new CGI;
$val=$query->param('link');
$redir= $query->redirect($val);
print $redir;
2. PROGRAM DESCRIPTION:
The first three lines are identical as slide #4
The fourth line gets the selected value
The fifth line calls the redirect method
The sixth line sends the result back to your browser.
|