单击其中一个按钮时,我无法一次只执行一个脚本。单击按钮时,代码将一起执行 2 个脚本。我怎样才能一次只执行一个脚本,而特定的按钮执行特定的脚本。谢谢您的帮助。下面是我的代码。
<html>
<head>
<script language="javascript" type="text/javascript">
function popup(){
window.location = 'testing.php?run=shell';
}
function popdown(){
window.location = 'testing.php?run=shell';
}
</script>
</head>
<body>
<input type="button" onclick="popup()" value="popup">
<?php
if(isset($_GET['run']) && ($_GET['run'] == 'shell')){
echo shell_exec('sh bash_test.sh');
}
?>
<input type="button" onclick="popdown()" value="popdown">
<?php
if(isset($_GET['run']) && ($_GET['run'] == 'shell')){
echo shell_exec('sh bash_run.sh');
}
?>
</body>
</html>