468,747 Members | 1,733 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,747 developers. It's quick & easy.

PHP/ command-line program

11
Hi all,
I need to execute a command-line program through PHP.
I have a form which includes a textarea, where the user writes his data.
These data will be used as input for the command-line program.
Will I go something like:

$data = $_GET['info'];
Which function shall I use? System, exec, shell_exec, passthru?
I can't choose which one is the correct.

The programm running in the command-line is an biological algorithm which is complicated, and, of course not written by me, so I could interfere with the code.
It is an .exe program, called hmmpfam, so in the command line, I write:

hmmpfam [file in hard disk] [data submitted]

and the algorithm searches the [file in hard disk] for patterns that match the [data submitted].

So, in the function that will be used, the data supplied by the user will be passed as my second argument (the 1st argument is a file in my hard disk).

And, lastly, do I need to change any global settings for PHP in order to perform such actions, ie running scripts via PHP programs???

Do you think it would help if I did anything with Perl? A kind of CGI-script??? I read tha PHP's functions are not wise to use in those cases...
Thanx a lot!
Oct 1 '05 #1
1 2431
pbmods
5,821 Expert 4TB
Heya, ktsirig.

Have a look at this page.
Dec 9 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Hugh Macdonald | last post: by
1 post views Thread by TEK | last post: by
8 posts views Thread by Siemel Naran | last post: by
8 posts views Thread by Charles Law | last post: by
4 posts views Thread by FluffyCat | last post: by
reply views Thread by czerwww | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.