/*With curl */ 02 $data = array( 03 "username"=>"256*********", 04 "from"=>"0712600648", 05 "recipients"=>"46769023234", 06 "message"=>"test+sms+monitor+", 07 "password"=>"***********", 08 "type"=>"normal" 09 ); 10 $url = "https://richrendatechnologies.com/bulkysms.php"; 11 $data = http_build_query ($data); 12 // Send the POST request with cURL 13 $ch = curl_init($url ); 14 curl_setopt($ch, CURLOPT_POST, true); 15 curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 16 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 17 $result = curl_exec($ch); 18 curl_close($ch); 19 echo $result; 20 /* 21 Without curl use the function commented out below 22 function do_post_request($url, $data, $optional_headers = null) 23 { 24 $params = array('http' => array( 25 'method' => 'POST', 26 'content' => $data 27 )); 28 if ($optional_headers !== null) { 29 $params['http']['header'] = $optional_headers; 30 } 31 $ctx = stream_context_create($params); 32 $fp = @fopen($url, 'rb', false, $ctx); 33 if (!$fp) { 34 throw new Exception("Problem with $url, $php_errormsg"); 35 } 36 $response = @stream_get_contents($fp); 37 if ($response === false) { 38 throw new Exception("Problem reading data from $url, $php_errormsg"); 39 } 40 return $response; 41 } 42 $data = array( 43 "username"=>"256*********", 44 "from"=>"0712600648", 45 "recipients"=>"46769023234", 46 "message"=>"test+sms+monitor+", 47 "password"=>"***********", 48 "type"=>"normal" 49 ); 50 $url = "https://richrendatechnologies.com/bulkysms.php"; 51 echo do_post_request($url, http_build_query ($data));*/