Page 1 of 1

linux Scripts and php

Posted: Fri Nov 07, 2008 2:15 am
by tafil
Hi,

I am new at PHP programing and i have not so much experience with PHP, my problem is like that i wrote few Shell Script that have to work on CentOS,i already configured the Apache Server but is it any possibility to make a simple PHP script or page that can execute the scripts and show me the output of the scripts on the PHP page.
I thought it like this to have a button and a text filed if i press the button it should execute the script and show the output of the script on the text filed.
The second thing is it possible to enter something on the text filed and if i press the button to add the text after the script (for example ./script.sh field text) and execute the script.

As i said i have no experience on php, I hope that someone can help me with a short example code.

Thanks in advance.

Re: linux Scripts and php

Posted: Fri Nov 07, 2008 6:11 am
by VladSun
Take a look at:
system()
passthru()
escapeshellcmd()
backtick operator
exec()
shell_exec ()

Re: linux Scripts and php

Posted: Fri Nov 07, 2008 6:21 am
by tafil
thanks for you help but i really don't understand that. Maybe someone has a sample code?
tahnks

Re: linux Scripts and php

Posted: Fri Nov 07, 2008 6:25 am
by VladSun
There are a *lot* of sample code snippets in the manuals of the functions I've pointed to in my previous post.