Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am the Perl developer for our company, I handle all the ecommerce and member systems. We have another guy that is a PHP guru, and does everything in PHP. We normally do stuff one time per day, I do all the transactions and qualfications for commissions, he takes the data I fill in then does his stuff with it.

Now we are working on a new program, where we can do this in real time. What I need it so pass him 3 variables and he will take those variables and give me a response

Here is the example I have tried but had fail:
my $_result = `php file.php memberid=$_memberid position=left referrer +=$_referrerid`;
I have the test php script read this way:
<?php my $_memberid = $_GET['memberid'] || $_POST['memberid'] || $memberid; my $_position = $_GET['position'] || $_POST['position'] || $position; my $_referrerid = $_GET['referrer'] || $_POST['referrer'] || $referrer +; echo "I have recieved the MemberID As: $_memberid and the Position as +$_position and finally the referring member id is: $_referrerid "; ?>

No matter what I try my cgi does not report that the way it should be, it has all the text, but none of the variables are read into php and then 'echoed' back.

Do any of you know of a way to do this?

He is just going to print only the id that he creates for the new 'affiliate' member. So I can place it in the members table.

I'd appreciate any assistance you can offer from any experience you have in this crazy area.

Richard

Replies are listed 'Best First'.
Re: executing a PHP script from my perl program.
by ikegami (Patriarch) on Jul 21, 2008 at 11:51 UTC
    I'm guessing from the special variable names that your PHP script is expecting to be run as a CGI request handler, but you didn't setup a CGI environment.
Re: executing a PHP script from my perl program.
by Anonymous Monk on Jul 21, 2008 at 11:44 UTC
    Thats how you execute a php script from perl. In perl, arguments passed that way are found in the variable @ARGV. in php it is also $argv