I have this php code
<?php
$Command = "cd /var/www/html/Codiad/workspace/workspace 2>&1; gcc HelloWorld.c; ./a.out"
$Method1 = exec($Command);
echo $Method1;
?>
The code works fine, it shows the output, but I want only see the output after click on a button. How can I do that remaining on the same page? To be more precise I have two buttons, one for compiling code and one for execute it.