in reply to autoredirect drop down box to perl files
If I understand your question correctly, you can simply have the main script redirect the parameter to other scripts depending on its value.
#!/usr/bin/perl -wT use strict; use CGI; my $q = new CGI; my $class = $q->param("class"); my %scripts = ( prog1 => "prog1.pl", prog2 => "prog2.pl", prog3 => "prog3.pl", ); if ( $scripts{$class} ) { print $q->redirect("$scripts{$class}?class=$class"); } else { error("You don't have permission to access $class"); } sub error { my $error = shift; print $q->header("text/html"), $q->start_html("Error"), $q->h1("Error"), $q->p("$error"), $q->end_html; exit; }
|
|---|