I want to create a simple ‘history’ feature for my linux-web based terminal.
The user can type in any linux command in the textbox. After pressing return, that command is actually executed on linux shell and using exec() function, I return the output on the browser.
When the user types in a keyword, such as ‘history’ in the textbox, then the last ten linux commands typed into the texbox will be shown. How can i implement that?
On test.php, get the command, execute it, and display the result.
UPDATE:: there you go, your complete code