Not sure about multiple servers but to open a new page you can do it with some javascript. I have added the javascript to a new clickme button as an example.
#!/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>Add Logical:</h2> <form name="form" method="post" action="n.cgi"> <table> <tr> <td align="right"><strong>Logical:</strong></td> <td> <textarea id="ta" name="server" rows="1" cols="30" wrap="soft"></te +xtarea> </td> </tr> <tr> <td colspan="2"> &nbsp; </td> </tr> <tr> <td> <button type="button" onClick="javascript:clickme()">Click Me</ +button></td> <td> <input type="submit" name="action" value="Search" /> </td> </tr> </table> </form> EndOfText # construct URL my $URL = 'http://a.com:8080/bms/healthMonitor.do?method=redirect' .'&operation=BackupHistorySearch' .'&subOperation=GetReport' ."&fromDateStr=$FM&toDateStr=$TM"; # javascript my $JSCRIPT=<<EOF; function clickme(){ var URL = \'$URL\' + '&clientName=' + document.getElementById("ta").value // comment out if or remove when working OK if (confirm(URL)==true) { window.open(URL) }; } EOF # get parameters my $q = CGI->new; my $action = $q->param('action'); my $server = $q->param('server'); # add server $URL .= "&clientName=$server"; # redirect if required if ($action eq 'Search'){ # remove hash to redirect print $q->redirect($URL); } else { print $q->header, $q->start_html( -title => "Some Title", -script=> $JSCRIPT), $page, $q->end_html; }
poj

In reply to Re^4: Perl CGI redirect by poj
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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.