我想从 php 文件执行一个 perl 脚本。这个perl脚本必须通过点击来执行 标记。例如:
<a href="?????">Run now</a>
谁能告诉我如何提供链接和执行perl脚本?提前致谢
您可以使用 exec
php 函数。
http://php.net/manual/en/function.exec.php
在这种情况下,链接的目标将是一个简单的 php 脚本:
//simpleScript.php
<?php
exec("/path/to/your/perl/script.pl");
// + error and output handling. It depends of your script
// + other actions, return, redirect ...
在你的 HTML 中:
<a href="path/to/your/php/simpleScript.php">Run now</a>