hello all ..,
i want to make a simple cgi script that takes the command in the text field and then print back
in the next page ......,
first i create the form page that is command.pl
PHP Code:
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print"<html><head><title>Linux Commands</title></head>";
print"<body>";
print"<H1>Enter Your Command</H1>";
print"<form method='post' action='unix.pl'>";
print"Command: <input type='text' name='command' size=40>";
print"<br>";
print"<input type='submit' value='Submit'><br>";
print"<br>";
print"<input type='reset' value='Clear'>";
print"<br>";
print"</form>";
print"</body></html>";
second i made the action page (unix.pl) that the output will be printed in
PHP Code:
#!/usr/bin/perl -w
use CGI;
$cgi=new CGI;
print $cgi->header();
print $cgi->body("<p><center><h1> Commands action page</p><center></h1>"), $cgi$
$command = system "$input";
$input = $cgi->param('command');
print "$command";
print $cgi->end_html();
i tried to run that but at the unix.pl page the output was 65280
what that number mean and that happened with any command .