Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

how to take input from php and execute it in a command-line program in terminal linux

Writer 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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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