LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux terminal to php (https://www.linuxquestions.org/questions/linux-newbie-8/linux-terminal-to-php-4175424145/)

ruchirarsm 08-27-2012 12:42 AM

Linux terminal to php
 
Hi,
I was trying to send Linux commands to a terminal and get the respective outputs via a web browser by integrating the terminal with php and ajax.(simply I'm expecting an online putty command line to my web page which will communicate with host via SSH). guys please help me with this

TB0ne 08-27-2012 08:58 AM

Quote:

Originally Posted by ruchirarsm (Post 4765074)
Hi,
I was trying to send Linux commands to a terminal and get the respective outputs via a web browser by integrating the terminal with php and ajax.(simply I'm expecting an online putty command line to my web page which will communicate with host via SSH). guys please help me with this

You can look up the system and exec functions in PHP; in your case, I'd look at the exec function. It will run whatever external command you want (along with command-line arguments), and return the output of that to a variable, which you can then echo to the screen.

ruchirarsm 08-27-2012 10:31 PM

TB0ne Thanks for the quick solution. think this will help


All times are GMT -5. The time now is 02:58 PM.