Hi,
I have a simple page with a text box and a submit button. When i press the button I want to run a small bash script with the value in the text box as input and show the result in web page.
These are the scripts I use. Happy to get suggested if you have simple ones.
root@cpaneltest [/usr/local/apache/htdocs/test]# cat index.html
<!DOCTYPE html>
<html>
<body>
<div align="center" style="margin-top:275px;">
<form action="ip.php" >
IP Address: <input type="text" name="ip" />
<input type="Submit" value="Ping"/>
</form>
</div>
</body>
</html>
root@cpaneltest [/usr/local/apache/htdocs/test]#
root@cpaneltest [/usr/local/apache/htdocs/test]# cat ip.php
<?php
$ip = $_GET['ip'];
#$cmd = .adduser .. $u;
$cmd = .echo $ip;
$out = system($cmd);
?>
root@cpaneltest [/usr/local/apache/htdocs/test]#

Reply With Quote
