Reputation: 93
I have a python script on a vps that I run a simple command though.
./script.py [ipaddress] [portnumber]
example
./script.py 127.0.0.1 8080
What I'd like to do is put a simple php script on my apache server (same vps) with a form on the page to enter the ip address and port number into it.. Along with a go button.
After running the script I'd like it to display the scripts output below. IF possible (as im really just not sure) I'd like to be able to have several people use it at once... example.. 10 users all passing data to the same script at the same time.
My server is running CentOS
Upvotes: 2
Views: 78
Reputation: 5206
popen() is what you want
http://www.php.net/manual/en/function.popen.php
This allows you to run an arbitrary command and get the stdout result.
Upvotes: 4