I have problem to only execute one of the script at a time when one of the button is click. The code execute 2 script together when the button is click. How can I only execute one script at a time and specific button execute specific script. Thanks for the help. Below is my code.
<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>
Try this: