<?php
function advancedLookup($content) {
$ch = curl_init('http://www.smsglobal.com.au/mnp/hlr_network.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
curl_close ($ch);
return $output;
}
//SMSGlobal Details
$username = 'USERNAME';
$password = 'PASSWORD';
$msisdn = '61447100250'; //Lookup MSISDN
//Content to pass SMSGlobal
$content = 'username='.rawurlencode($username);
$content.= '&password='.rawurlencode($password);
$content.= '&msisdn='.rawurlencode($msisdn);
$smsglobal_result = advancedLookup($content);
//Sample Result
//OK 6526
$explode_result = explode(' ', trim($smsglobal_result));
if(count($explode_result) == 2 && $explode_result[0] == 'OK') {
//Lookup Success
$ref_code = $explode_result[1];
//Save into database -> SMSGlobal will post back results to your server / email
echo $ref_code;
}
?>