tomrector
asked on
Using Perl exec
newbe..... know enough to be dangerous
Want to run a perl script from a php script
$cmd = "../../../cgi-bin/RentUpda te1.pl
$aryVars = array();
$intRet = 1;
$lastLine = exec($cmd, $aryVars, $intRet) ;
$aryVars = array(); // this is my problem, I need to provide this on the end of the cmd
?ID=$ID_1&action=save&pass word=''&av ail=No&Nam e=$LName&D ue=$DueIte mA
as in:
"../../../cgi-bin/RentUpda te1.pl?ID= $ID_1&acti on=save&pa ssword=''& avail=No&Name= $LName &Due=$DueItemA"
as in:
"../../../cgi-bin/RentUpda te1.pl?ID= $ID_1&acti on=save&pa ssword=''& avail=No&Name= $LName &Due=$DueItemA"
or a better way if known? "can't use require"
Want to run a perl script from a php script
$cmd = "../../../cgi-bin/RentUpda
$aryVars = array();
$intRet = 1;
$lastLine = exec($cmd, $aryVars, $intRet) ;
$aryVars = array(); // this is my problem, I need to provide this on the end of the cmd
?ID=$ID_1&action=save&pass
as in:
"../../../cgi-bin/RentUpda
as in:
"../../../cgi-bin/RentUpda
or a better way if known? "can't use require"
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry I have not responeded been busy...
Still no luck,,
To be clear:
this works from the address bar
http://www.MYSITE.com/cgi-bin/RentUpdate1.pl?ID=2130&action=save&password=''&avail=No&Name=Rector&Due=08 Sep 2013
I need that to work calling it from a php script.
i.e.
http://www.MYSITE.com/cgi-bin/RentUpdate1.pl?ID=$ID_1&action=save&password=''&avail=No&Name=$LName&Due=$DueItemA
I do not really need any additional resulting output.
Thanks
Still no luck,,
To be clear:
this works from the address bar
http://www.MYSITE.com/cgi-bin/RentUpdate1.pl?ID=2130&action=save&password=''&avail=No&Name=Rector&Due=08 Sep 2013
I need that to work calling it from a php script.
i.e.
http://www.MYSITE.com/cgi-bin/RentUpdate1.pl?ID=$ID_1&action=save&password=''&avail=No&Name=$LName&Due=$DueItemA
I do not really need any additional resulting output.
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How does that invalidate my suggestion?
The problem the OP is having is in formatting the command correctly so that it can be executed via the exec() function. The type of output that is generated/captured and its processing wasn't part of the question, as far a I can tell.
Here's a working/tested example php script that calls the perl script. I adjusted the perl script to only output the params data.
Open in new window
Open in new window
PHP Output: