how to take input from php and execute it in a command-line program in terminal linux
Andrew Henderson
i cant take an input enter by a user to load the input in a Linux terminal to execute it in a command line program...can you help please...for example when a user enter a value and press enter in must open terminal in the background and take the input and execute it in a command line program
1 Answer
Start by using shell_exec() and any of the other Program execution Functions. Have a good read through the comments also.
Using a bit of AJAX could emulate a basic terminal if you don't want to reload the page each time.
Should also be careful what commands can be sent since letting anyone run these commands is a big security risk.