I have this current small code which will execute a .sh file depending what button was pressed:
PHP Code:
<?PHP
if(isset($_POST['restartbot'])) {
echo 'Bot restarted';
chdir('/home/rtcw/wab-1.0a');
exec("./wab-restartwab.sh", $output);
echo $output;
exit();
}
if(isset($_POST['restartserver'])) {
echo 'Server Restarted';
chdir('/home/rtcw/wab-1.0a');
shell_exec("./wab-restartwolf.sh");
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method = "post">
<input type="Submit" name="restartbot" value="Restart Bot"><br />
<input type="Submit" name="restartserver" value="Restart Server">
</form>
Now this does work and it does restart the server and bot when i press the button, so the files are being executed. Although when I press the button the page just loads and never actaully displays any of the text I want it to echo. Instead the loading bar on IE just slowly crawls along even though the command has been exacuted it still doesnt load the page.
In Firefox when I click on a button it does display the text in the echo but the loading bar stops halfway and says "Transfering Data From xxx.xxx.xxx.xxx:"
I have no idea whats causing the page not to load even though the exec has been done. So any help or ideas on this would be great
Thanks