Это должно помочь:
<?php
if (isset($_GET['folderPath']) && !empty($_GET['folderPath']) && isset($_GET['group1']) && isset($_GET['group2'])) {
$run = shell_exec("shell.sh $_GET['folderPath'] $_GET['group1'] $_GET['group2']");
var_dump($run);
}
?>
Обратите внимание, что вам также следует добавить некоторую функцию для проверки folderPath
.
Это будет делать то же самое:
<?php
if (isset($_GET['folderPath']) && !empty($_GET['folderPath']) && isset($_GET['group1']) && isset($_GET['group2'])) {
echo $_GET['folderPath'];
echo "<br />\n";
$folderPath = $_GET['folderPath'];
$group1 = $_GET['group1'];
$group2 = $_GET['group2'];
echo $folderPath;
echo "<br />\n";
$run = shell_exec("shell.sh $folderPath $group1 $group2");
var_dump($run);
}
?>
Полный пример:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Something</title>
</head>
<body>
<header>
<nav>
<ul class="nav-links">
<li><a href="">Home</a></li>
</ul>
</nav>
</header>
<form action="">
<label for="folderPath">Folder Path:</label>
<input type="text" id="folderPath" name="folderPath">
<br></br>
<fieldset id="khz">
<p>Please Choose Bits: </p>
<input type="radio" value="eightbits" name="group1"> 8 bits <br>
<input type="radio" value="sixteenbits" name="group1"> 16 bits <br>
</fieldset>
<br></br>
<fieldset id="audio-type">
<p>Please Choose Type: </p>
<input type="radio" value="ch12" name="group2"> CH12 <br>
<input type="radio" value="lr" name="group2"> LR <br>
</fieldset>
<input type="submit" value="Submit">
<?php
if (isset($_GET['folderPath']) && !empty($_GET['folderPath']) && isset($_GET['group1']) && isset($_GET['group2'])) {
$run = shell_exec("shell.sh $_GET['folderPath'] $_GET['group1'] $_GET['group2']");
var_dump($run);
}
?>
</body>
</html>
Сохраните этот файл как: testpage. php