Friday, September 16, 2011

Php cUrl Example


Send sms without page refresh, the help of cUrl.
Instigate sms Api Easley .
sms API makes it easy for developers to send  SMS messages from any website. 
Code 
<?php
$urltopost="http://txtji.com/sms_api_send";
$datatopost = array (
    "akey" => "XNLp9tQlbc5W5yK6YdLxFh84VpnWaTo7jmgVlyLe-u6nwsFwPqAhrpXbZ-I8SKOKm83fGOq13Hq0BnXe1jw2VQ",
    "message" => "JAFAR ",
    "recipient" => "9451293997"
    );
$ch = curl_init ($urltopost);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $datatopost);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$returndata = curl_exec ($ch);
curl_close($ch);
echo $returndata;

?>

No comments:

Post a Comment