First name
Email address
Subject
$username, password => $password, message => $message, msisdn => $msisdn ); foreach($post_fields as $key=>$value) { $post_body .= urlencode($key).'='.urlencode($value).'&'; } $post_body = rtrim($post_body,'&'); curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_body); $response_string = curl_exec($ch); $curl_info = curl_getinfo($ch); if ($response_string == FALSE) { print "cURL error: ".curl_error($ch)."\n"; } elseif ($curl_info['http_code'] != 200) { print "Error: non-200 HTTP status code: ".$curl_info['http_code']."\n"; } else { print "Response from server:$response_string\n"; $result = split('\|', $response_string); if (count($result) != 3) { print "Error: could not parse valid return data from server.\n".count($result); } else { if ($result[0] == '0') { print "Message sent - batch ID $result[2]\n"; } else { print "Error sending: status code [$result[0]] description [$result[1]]\n"; } } } curl_close($ch); ?>
.