#! C:\perl\bin\perl.exe
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use XML::Simple;
my $path = "C:\\web\\paging\\user_pref";
# New cgi
# Some Security Holes Plugged
$CGI::DISABLE_UPLOADS = 1; # Disable uploads
$CGI::POST_MAX = 1024; # limit posts to 1K max
my $q = new CGI;
# Get and untaint data
my $enter_submits = $q->param('enter_submits');
if ( $enter_submits =~ /^([yes|no]+)$/ ) {$enter_submits = $1}
else {
print "Content-type: text/html\n\n";
print "Only yes and no are legal options!";
exit;
}
###########################
# Update user preferences #
###########################
my $xs = new XML::Simple;
my $User_Preferences = {
'logdir' => '/var/log/foo/',
'debugfile' => '/tmp/foo.debug',
'server' => {
'sahara' => {
'osversion' => '2.6',
'osname' => 'solaris',
'address' => [ '10.0.0.101', '10.0.1.101' ]
},
'gobi' => {
'osversion' => '6.5',
'osname' => 'irix',
'address' => '10.0.0.102'
},
'kalahari' => {
'osversion' => '2.0.34',
'osname' => 'linux',
'address' => [ '10.0.0.103', '10.0.1.103' ]
}
}
};
$xs->XMLout($User_Preferences, AttrIndent => 1, NoAttr => 1, OutputFile => "$path\\$ENV{'LOGON_USER'}.xml");
# print webpage .....
Any help would be greatly appreciated.perlmonks.org content © perlmonks.org and bkiahg, Wonko the sane
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03