cURL PHP: Connecting to Invoicing System

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-04-02T09:38:48Z Indexed on 2010/04/02 9:43 UTC
Read the original article Hit count: 426

Filed under:
|
|

I am attempting to use cURL to connect to a page like this: https://clients.mindbodyonline.com/asp/home.asp?studioid=851 with the following code;

<?php

$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'https://clients.mindbodyonline.com/asp/home.asp?studioid=851');
//curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl_handle,CURLOPT_HTTPAUTH, CURLAUTH_ANY);

curl_setopt($curl_handle,CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
curl_setopt($curl_handle,CURLOPT_COOKIEFILE, '/tmp/cookies.txt');

//curl_setopt($curl_handle,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_handle,CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1);

//curl_setopt($curl_handle,CURLOPT_HEADER, 1);
//curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER, 1);
//curl_setopt ($curl_handle,CURLOPT_POST, 1);

$buffer = curl_exec($curl_handle);
curl_close($curl_handle);

if (empty($buffer))
{
    print "Sorry, The booking system appears to be unavailable at this time.<p>";
}
else
{
    print $buffer;
}
?>

I've fiddled the settings and the only three responses I get are;

  1. Nothing is loaded and the error message is called
  2. A redirect to /asp/home... locally
  3. Returns '1' and that's all

Thanks for your time!

© Stack Overflow or respective owner

Related posts about php

Related posts about curl