Using curl to POST rather than a <Form>

I have to submit form content to a different web site. Using the action in the Form tag works fine. But I need to make the submission from the PHP script because some calculations have to be made on the base data before submission.

Problem is the host keeps redireting me to a page that says I need to enable cookies in my browser.

I’m not very familiar with curl but from the examples I have seen it appears that I am enabling cookies. Can someone tell me what else I need.

Here’s the relevant part of my code:

$post = curl_init();

curl_setopt($post, CURLOPT_COOKIESESSION, 1);

curl_setopt($post, CURLOPT_URL,“https://xxxxx.com”);
curl_setopt($post, CURLOPT_POST, 1);
curl_setopt($post, CURLOPT_POSTFIELDS, $postString );

curl_exec ($post);
curl_close ($post);

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.