How to Take Input from Php and Execute It in a Command-Line Program in Terminal Linux

How to Take Input from Php and Execute It in a Command-Line Program in Terminal Linux

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.