این نمونه کدی هست که من برای سستم خودمون نوشتم
<?php
if (isset($_POST['sms_send'])){
$s_u=$_POST['sms_u'];
$s_p=$_POST['sms_p'];
$s_n=$_POST['sms_n'];
$to=$_POST['to'];
$text=$_POST['text'];
echo $a=sendsms($s_u,$s_p,$to,$text);
if($a)
{echo"پیام فرستاده شد";}
}
function sendsms($s_u,$s_p,$to,$text){
$host="newsms.ir";
$path="/API/SendSMS.aspx";
$site=$_SERVER['HTTP_HOST'];
$sitefu=$_SERVER['REQUEST_URI'];
$data_to_send="username=$s_u&password=$s_p&to=$to& text=".urlencode($text);
$fp = fsockopen($host,80);
$outp="POST $path HTTP/1.1\n";
$outp.="Host: $host\n";
$outp.="Content-type: application/x-www-form-urlencoded\n";
$outp.="Content-length: ".strlen($data_to_send)."\n";
$outp.="Connection: close\n\n";
$outp.=$data_to_send;
fputs($fp,$outp);
fclose($fp);
}
?>