I really appreciate the help guys. I did the error display (which I had totally forgot about) and var_dump. The URL I was given was indeed wrong, so I fixed that and now this is the result of the var_dump:
(Array ( [url] => ? [content_type] => text/html [http_code] => 200 [header_size] => 179 [request_size] => 260 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 1.482467 [namelookup_time] => 0.093922 [connect_time] => 0.159533 [pretransfer_time] => 0.159608 [size_upload] => 48 [size_download] => 5 [speed_download] => 3 [speed_upload] => 32 [download_content_length] => 5 [upload_content_length] => 48 [starttransfer_time] => 1.482432 [redirect_time] => 0 [certinfo] => Array ( ) [primary_ip] => 72.2.118.196 [primary_port] => 80 [local_ip] => 184.154.132.242 [local_port] => 59436 [redirect_url] => ) 0- string(5) "101|1")
Apparently 200 is a mobile phone required code according to (http://demo.catchwind.com/api/optin/?help)
I am fairly new to APIs in forms. I can't seem to wrap my head around what I'm missing. Is it a simple typo?
This is what I have:
if(isset($_POST['submit'])) {
/* Variables ----------------------- */
$phone = $_POST['phone'];
$list = $_POST['list'];
/* Form Action ----------------------- */
$myvars = 'mobile_phone='.$phone.'&list0='.$list.'&pin_request';
/* Connect to Site --------------------- */
$curl_connection = curl_init('pocketpleasers.catchwind.com/api/function/optin/?');
// set connection timeout
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
// set browser ID
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
// return as string
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
// do not trigger error
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
// follow redirects
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
//set data to be posted
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $myvars);
/* Results ----------------------- */
// request
$result = curl_exec($curl_connection);
/* Error Check ---------------------- */
print_r (curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' . curl_error($curl_connection);
// close connection
curl_close($curl_connection);
}