gpt4 book ai didi

php - 从 html 按钮运行脚本

转载 作者:太空宇宙 更新时间:2023-11-04 03:35:29 26 4
gpt4 key购买 nike

我有一个 html 按钮:

<a  class="btn btn-sm btn-danger"><i class="ace-icon fa fa-reply"></i>Reset CM</a>

和一个 Angular 变量:“{{product.name}}”

我喜欢用这个按钮运行这个命令:

./cm-reset2.sh -r 172.31.31.10 -k hk15#inhp -m {{product.name}}

知道怎么做吗?我无法将文件从 html 移动到 php。

谢谢

最佳答案

你可以定义一个路由,比如你调用的“/run_command”(可能通过ajax,post/get取决于你是否期望一些响应数据),并且从你的php处理程序中你可以执行shell_exec并运行所需的脚本。

关于php - 从 html 按钮运行脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31728403/

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