Running Curl from PHP CLI
Posted: Tue Sep 15, 2009 2:17 pm
Hi,
WIN32 IIS (2003 Server)
I have a basic PHP script that runs fine on IIS to pull an array from an MSSQL DB and use Curl to post to an external server that uses the information from my DB.
I now need to run the script from the CLI to run via the task manager.
Worked fine when done on the web. Using the same code calling from a batch script using C:\path\to\PHP\php.exe C:\path\to\script\foo.php returns good results when it echoes to the sreen but my Curl output on the external server is looses the variable values. It posts literally :
[part_number] => $row[\"PartNumber\"] ....................
Any ideas on what I'm doing wrong here, I have found nothing searching the net.
Thanks...
WIN32 IIS (2003 Server)
I have a basic PHP script that runs fine on IIS to pull an array from an MSSQL DB and use Curl to post to an external server that uses the information from my DB.
I now need to run the script from the CLI to run via the task manager.
Code: Select all
while($row = mssql_fetch_array($result))
{
echo "<li>" . $row["CreatedDate"] . $row["PartNumber"] . $row["Quantity"] . $row["Manufacturer"] . $row["Condition"] . $row["Description"] . $row["Hot"] ."</li>";
require_once('CurlClass.php');
$cc = new cURL();
$cc->post('http://www.blabla.com',part_number=$row["PartNumber"]&quantity=$row["Quantity"]&manufacturer=$row["Manufacturer"]&condition=$row["Condition"]&description=$row["Description"]&hot=$row["Hot"]');
[part_number] => $row[\"PartNumber\"] ....................
Any ideas on what I'm doing wrong here, I have found nothing searching the net.
Thanks...