I am trying to use CURL functions in PHP to add products to a cart. However, after trying a few different ways of passing the form fields, I haven't had any success. I have not found a way yet to enable Zen Cart to correctly receive/interpret the form field values for products_id and cart_quantity.
Here is essentially what I am trying to do:
<?php
$url = "https://localhost/shop/index.php?main_page=product_info&action=add_product";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, "products_id=55&cart_quantity=1&" );
curl_exec( $ch );
?>
Can anyone shed some light on this? Any ideas on how can I get this to work?
Thanks!



