gpt4 book ai didi

php - 如何使用按钮在 html 脚本中执行 python 脚本?

转载 作者:搜寻专家 更新时间:2023-10-31 21:19:27 25 4
gpt4 key购买 nike

<分区>

我正在使用 debian 开发树莓派,我想在带有按钮的 html 脚本中执行 python 脚本。我还在网站上使用 apache2。

我是初学者,尝试用 jquery 和 django 来做,但都没有用。

我最后停止的一些代码:

    <form method="post">

<input type="submit" value="GO" name="GO">
</form>

<script language="php">
if(isset($_POST['GO']))
{
shell_exec("/var/www/start.py");
}
</script>

它们没有错误,但是脚本代码没有被执行。我检查了 python 脚本,没问题。该按钮也有效。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com