Thanks for the help... Changed it to add text box. However this is opening in the same page. Is is possible to open on a new page and also check for mutiple servers
#!/usr/bin/perl # n.cgi use strict; use CGI qw( :standard ); use CGI::Carp qw( fatalsToBrowser ); use POSIX qw(strftime); my $today = time; my $yesterday = $today - 60 * 168 * 60; my $FM = strftime "%m-%d-%Y", ( localtime($yesterday) ); my $TM = strftime '%m-%d-%Y', localtime; # page layout my $page =<< "EndOfText"; <h2>NBU Backup Report</h2> <form name="form" method="post" action="n.cgi"> <table> <tr> <td align="right"><strong>Hostname</strong></td> <TD> <TEXTAREA NAME="server" ROWS=1 COLS=30 WRAP="server"></TEXTAREA> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td> </td> <td> <input type="submit" name="action" value="Search" /> </td> </tr> </table> </form> EndOfText # get parameters my $q = CGI->new; my $action = $q->param('action'); my $server = $q->param('server'); # construct URL my $URL = "http://a.com:8080/bms/healthMonitor.do?method=redirect&oper +ation=BackupHistorySearch&subOperation=GetReport&clientName=$server&f +romDateStr=$FM&toDateStr=$TM"; # redirect if required if ($action eq 'Search'){ # remove hash to redirect print $q->redirect($URL); } else { print $q->header, $q->start_html('Page Title'), $page, # hash out next 2 lines or remove if OK # $q->p("Vars action=$action : server=$server : FM=$FM : TM=$TM "), $q->a({-href=>$URL, -target=>'_blank'},$URL), }
In reply to Re^3: Perl CGI redirect
by Anonymous Monk
in thread Perl CGI redirect
by aksusa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |