- 论坛徽章:
- 0
|
原帖由 ruguo 于 2007-3-8 01:32 发表
没有用过perl,着急需要一个小程序,请大家帮帮忙,谢谢
一个网页里面有一个input 和一个提交按扭,当点击提交时,把input的值作为一个shell 程序的参数,并执行这个shell程序
就这样,不知道能不能实现,
Yes, CGI can do that!
For eaxpmle to call shell ls with option -la:
html:
<input type=hidden, name="opt" value="-la">
perl:
use CGI;
my $q = new CGI;
my $opt = $q->param('opt');
my $cmd = `ls $opt /tmp`;
# more code ...
I give you simple tips and you should do it further by yourself.
PS: using CGI to call a shell is alway a security risk for your system.
-- ulmer |
|