#!/usr/bin/perl
use CGI;
# File: time1.pl
use CGI ':standard';
$current_time = localtime;
#
print header,
start_html('A Virtual Clock'),
h1('A Virtual Clock'),
"The current time is $current_time.",
hr,
end_html;
$base_address = '/www/jshankar/search';
$base_url = 'http://xyz.com/~abc/search';
$co = new CGI;
if ($co->param()) {
$BuildExecute = $co->param('BuildExecute');
}
print $co->header,
$co->start_html
(
-title=>'CGI Example',
-author=>'Shankar',
-meta=>{'keywords'=>'CGI Perl'},
-BGCOLOR=>'pink',
-LINK=>'green'
),
$co->center
(
$co->h1
(
'Welcome CGI-BIN Script!'
)
),
$co->center
(
$co->h2
(
'IGT Script'
)
),
"Please enter your password: ",
$co->p,
$co->password_field
(
-name=>'password',
-default=>'open sesame',
-size=>30,
),
"you might be interested in ",
$co->a({href=>"http://www.cpan.org/"},"CPAN"), ".",
$co->hr,
$co->start_form
(
-name=>'form1',
-method=>'POST',
-action=>"http://IP/manual/mod/core.html#documentroot"
),
"Please check the script you want to execute: ",
$co->p,
$co->center
(
$co->checkbox_group
(
-name=>'checkboxes',
-values=>['Products','Build File','Go']
)
),
$co->p,
$co->hidden
(
-name=>'BuildExecute',
-override => 1,
-default => $BuildExecute
),
$co->p,
$co->center
(
$co->submit('Add to Build Execute'),
$co->reset,
),
$co->p,
$co->hr,
$co->end_form,
$co->start_form
(
-name=>'form2',
-method=>'POST',
-action=>"http://xyz.com:8080/navbar/"
),
$co->hidden
(
-name=>'BuildExecute',
-override => 1,
-default => $BuildExecute
),
$co->center
(
$co->submit('Go to Build Script Location'),
),
$co->end_form,
$co->start_form
(
-name=>'form3',
-method=>'POST',
-action=>"http://www.iciciprulife.com/public/default.htm"
),
$co->hidden
(
-name=>'BuildExecute',
-override => 1,
-default => $BuildExecute
),
$co->center
(
$co->submit('See Your Build Status'),
),
$co->p,
"Please select the numbers: ",
$co->p,
$co->popup_menu
(
-name=>'popupmenu',
-value=>['Blank','1','2','3','4'],
'Blank',
),
$co->p,
"Please select the Alphabets: ",
$co->p,
$co->popup_menu
(
-name=>'popupmenu',
-value=>['Blank','A','B','C','D'],
'Blank',
),
$co->p,
"Please select the command: ",
$co->p,
$co->popup_menu
(
-name=>'popupmenu',
-value=>['Blank','ls','mkdir','cat','cd'],
'Blank',
),
$co->p,
"Please select the dir path: ",
$co->p,
$co->popup_menu
(
-name=>'popupmenu',
-value=>['Blank','/home/test','/home/test/newdir'],
'Blank',
),
$co->p,
(
$co->submit('Submit'),
$co->reset,
),
$co->p,
"Please enter your opinion: ",
$co->p,
$co->textarea
(
-name=>'textarea',
-default=>'No opinion',
-rows=>10,
-columns=>60
),
$co->p,
"Thank you for submitting Build. Please indicate how
much unsolicited mail you like to get: ",
$co->p,
$co->popup_menu
(
-name=>'popupmenu',
-values=>['Very much','A lot','Not so much','None'],
),
$co->p,
$co->hidden
(
-name=>'hiddendata',
-default=>'Rosebud'
),
$co->p,
(
$co->submit('Submit'),
$co->reset,
),
$co->start_html("Check if someone is logged in"),
$co->center
(
$co->h1("Check if someone is logged in...")
),
$co->p,
$co->start_form,
$co->center
(
"Please enter the person's login name: ",
$co->textfield('person'),
$co->p,
$co->submit('Check'),
$co->reset
),
$co->end_form;
if ($person = $co->param('person')) {
foreach (`who`) {
if (/^$person\s/) {
print
$co->center
(
$co->h2
(
"Yes, $person is logged in.",
)
),
$co->end_html;
exit;
}
}
print
$co->center
(
$co->h2
(
"$person is not logged in, sorry.",
)
);
}
$co->end_form,
$co->end_html;
___________________________________
Above are the codes I have written, It's my first script, so I don't have much knowledge, how to process?
Using this script I want to execute the the script which is on the other system.
Kindly help me to resolve the issue.
Thanks -