Running a PHP script within a Perl script

Posted By: rowanp ()
Posted On: 2005-Apr-25 20:24

Hi

I need to run a PHP script within a Perl script. I need to send the PHP file certain variables from the Perl script. What I would send would look something like
.../sales.php?userid=4323&total=432.32&productid=4332

What would be the best way to do this? Running it with the system command does not seem to work properly.

Regards

rowanp.


Posted By: Prowler (Staff)
Posted On: 2005-Apr-27 13:29

The best plan would be to write the functionality you have in the PHP script into Perl itself. But if you insist that you need to invoke the PHP script, try the backtick. (`).

It assumes that you set the path for the PHP binary and the script path before you invoke. If this sounds daunting, you can do a roundabout way of invoking directly the script in question. Use wget again by using a backtick.