init III
This commit is contained in:
29
Perl CGI C2/admin/save_host.pl
Normal file
29
Perl CGI C2/admin/save_host.pl
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/perl
|
||||
|
||||
use Mysql;
|
||||
use strict;
|
||||
use CGI qw(:standard);
|
||||
|
||||
my $v0 = param('descr');
|
||||
my $v1 = param('hostname');
|
||||
my $v2 = param('ip');
|
||||
my $v3 = param('roc');
|
||||
my $v4 = param('rwc');
|
||||
my $v5 = param('port');
|
||||
|
||||
my $dbh = DBI->connect("DBI:mysql:database=c2;host=localhost",'root','', {RaiseError => 1});
|
||||
|
||||
print header();
|
||||
|
||||
print "<html>\n";
|
||||
print "<head>\n";
|
||||
print "<style type='text/css'>\n";
|
||||
print "select { font-size:8pt }\n";
|
||||
|
||||
print "</style>\n";
|
||||
|
||||
print "</head>\n";
|
||||
print "<body>\n";
|
||||
$dbh->do("insert into hosts (description,hostname,ip,ro_community,rw_community,snmp_port) values ('$v0','$v1','$v2','$v3','$v4','$v5')");
|
||||
|
||||
print "</body>\n</html>\n";
|
||||
Reference in New Issue
Block a user