Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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"> &nbsp; </td> </tr> <tr> <td> &nbsp; </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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-24 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found