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),
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|