$url = "https://www.sparktraffic.com/api.php";
$fields = array(
'key'=>urlencode('7111ee02ef5c48623ea0807d9aeaaba'),
'action'=>urlencode('balance'),
);

$fields_string = "";
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
$fields_string = rtrim($fields_string, '&');

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
print $result;

Leave a Reply

Your email address will not be published. Required fields are marked *