ckant8 has asked for the wisdom of the Perl Monks concerning the following question:
#!"D:\Program Files\xampp\perl\bin\perl.exe" use CGI; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); $co = new CGI; print $co->header, $co->start_html(-titile => 'Welcome'), $co->center ($co->h1('Welcome')), $co->start_form ( -method=>'POST', + -action=>"test12.cgi", ), "Enter host name/ip : ", $co->textfield ( -name=>'text1', + -value=>'', ), $co->submit('Submit'), $co->reset, $co->end_form(); $co->end_html; --------- second script test12.cgi --------- #!"D:\Program Files\xampp\perl\bin\perl.exe" use CGI; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use Net::Telnet; my @output1,@host,@output; my $telnet = new Net::Telnet ( Timeout=>90, Errmode=>'die',input_log=> +'input.log',output_log=>'output.log',Dump_Log=>'dump.log',Option_log= +>'option.log'); $co = CGI->new; print $co->header, $co->start_html(-titile => 'Welcome'), $co->center ($co->h1('Welcome....')); if($co->param()) { @host=$co->param('text1'); } @output1=$telnet->open(@host); if (@output1) { $telnet->waitfor('/login: $/i'); $telnet->print('xxxxx'); $telnet->waitfor('/Password: $/i'); $telnet->print('xxxxxxx'); $telnet->waitfor('/# $/i'); print "Connected to host : <b>@host</b>", $co->start_form ( -action=>"&ver1()"); print qq(<input type="submit" name="bsubmit" value="State" +>\n); print "<hr>", $co->end_form(); sub ver1() { print "test"; } } print $co->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl CGI multiple buttons (http/ajax)
by Anonymous Monk on Feb 25, 2013 at 12:18 UTC | |
by ckant8 (Acolyte) on Feb 25, 2013 at 17:06 UTC | |
by marto (Cardinal) on Feb 26, 2013 at 11:44 UTC | |
by Anonymous Monk on Feb 26, 2013 at 08:06 UTC | |
|
Re: Perl CGI multiple buttons
by Anonymous Monk on Feb 25, 2013 at 12:03 UTC | |
|
Re: Perl CGI multiple buttons
by 7stud (Deacon) on Feb 26, 2013 at 01:55 UTC |