html按钮来调用php shell_exec命令 [英] html button to call php shell_exec command

查看:1043
本文介绍了html按钮来调用php shell_exec命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个谷歌,我无法得到这个答案。我讨厌php,但出了php的人太忙了,我需要帮助!

I have google the heck out of this an I cannot get an answer to this. I hate php, but out php guy is too busy and I need HELP!

我想从一个html按钮调用perl脚本。但是,我只是想让它在后台运行,我不需要显示任何东西......会有这样的工作吗?

I want to call a perl script from an html button. But, I just want it to run in the back ground, I don't need to display anything from it... Would something like this work?

<html>
<body>
    <p>
        <button onclick=<?php exec('test.pl') ?>Run Perl</button>
    </p>
</body>

我不想使用cgi,我想尽可能简单。

I would prefer not to use cgi, I want to keep this as simple as possible.

谢谢

Thanks

推荐答案

这不起作用,您必须为即:

That will not works, you have to create an action for that:

<?php
    if (isset($_POST['button']))
    {
         exec('test.pl');
    }
?>
<html>
<body>
    <form method="post">
    <p>
        <button name="button">Run Perl</button>
    </p>
    </form>
</body>

这篇关于html按钮来调用php shell_exec命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆