1
How do I pass an input or select value as a variable to a shell_exec ?
I have the following form:
<form action="speedtest.php" method="POST" id="SpeedTest" class="form">
  <p>
    <label>Quantidade de testes a serem executados: </label>
  </p>
  <input type="tel" name="testes" class="testes" maxlength="1" required>
  <button type="submit" class="qts" value="Executar" onclick="Oculta('main')">Executar</button>
</form>
This form sends the amount of speed test runs that will be done on the server. Below I have the script that runs the speed tests:
<?php
shell_exec('/bin/speedtest -l');
?>
The "value" variable coming from the input form would enter the middle of "Speedtest -l", for example, if you filled in 2 in the input that number would enter this way in shell_exec: Speedtest 2 -l
Any suggestions on how I can do this?
Someone who can help me with that ?
– Rooh Macedo