PHP system() passing name_value pairs?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rxsid
Forum Commoner
Posts: 82
Joined: Thu Aug 29, 2002 12:04 am

PHP system() passing name_value pairs?

Post by rxsid »

Hi all,

How would I do this:
Have a PHP script, call a PERL script and pass <input type=hidden> fields (or just the name_value pairs) to that PERL script...and then return to the PHP script?

something like:

Code: Select all

$return = system($thePerlScript, '$variableA=something,$variableB=anotherthing');
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

explain a little more? sorry not getting what your asking.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

depends on how those variables are read by the perl-script.
There are mainly two ways to make values available for (child)processes.
  • By passing arguments: myPrg arg1 arg2 arg3. Those are available within a perl-script via the array @ARGV (e.g. $ARGV[0], $ARGV[1], ...)
  • By setting enviroment variables, accessable via %ENV (e.g. $ENV{home}) in perl.
make your choice :D
Post Reply