Web Hosting Talk







View Full Version : Executing Shell command


mithilesh
01-29-2002, 03:44 PM
I had written a shell script and now I want to execute this script in a PHP page.How can I do it.

plz tell me.

allan
01-29-2002, 04:25 PM
You can using the

string exec

command:

http://www.php.net/manual/en/function.exec.php

mithilesh
01-29-2002, 04:37 PM
Actually I had written one shell script say xyz which accepts some arguments for executing like

$xyz arg1 arg2 arg3

Now I want to make a php page and accept the value from user by some text boxes and on the submission button I want to execute this program xyz.
Can you give me some tips for the resolving this problem.


Thank you

allan
01-29-2002, 06:40 PM
That's beyond my capabilities, you may want to post that to the forums at phpbuilder.com, or wait for kunal to come around :D

cyansmoker
01-29-2002, 09:31 PM
Front-end: the usual web form, then upon submission you create a cmd string with: full_path_to_cmd space $field1 space $field2 etc

Back-end: system() or exec() your script.

But above all, there's such thing as a php web site; it's called php.net.
So...


(yes...yes...you see it coming...) RTFM