Page 1 of 1

UNIX Shell Scripts that requires input from user in PHP

Posted: Wed Sep 01, 2010 6:05 pm
by dpittman36
Hi I am a Newbie to the forum.

Is it possible to run a UNIX shell script that requires input from users in a PHP page?
Does anyone have an example or tutorial.
I am familiar with system(), passthru, and shell_exec.

Suppose I ran a UNIX shell script (change_date.sh) in UNIX .
The script will prompt user to enter new date. (User enters date)
Afterward, ask user are you sure you want to change date. (User enters Y or N)

How do I call change_date.sh in my PHP page to do the same thing?

Thanks

Re: UNIX Shell Scripts that requires input from user in PHP

Posted: Wed Sep 01, 2010 6:32 pm
by Gargoyle
yes, possible, but you need to open a pipe to the process. see php function popen().

Re: UNIX Shell Scripts that requires input from user in PHP

Posted: Thu Sep 02, 2010 1:03 pm
by dpittman36
Any good tutorial sites you can recommend?
I still cannot find anything similiar to what I am looking for.

Thanks