471,070 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,070 software developers and data experts.

PHP/ command-line program

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 2536
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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.