napisałem taki kod:
function curl ($url, $post = NULL, $ref = NULL, $follow = 1, $header = 1, $post_type = NULL)
{
$ch = curl_init ($url);
curl_setopt($ch, CURLOPT_ENCODING , '');
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7');
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
// Zapisywanie ciastek do pliku
curl_setopt
($ch,CURLOPT_COOKIEJAR
, dirname(__FILE__).'/cookie.txt'); curl_setopt
($ch,CURLOPT_COOKIEFILE
, dirname(__FILE__).'/cookie.txt');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
if ( $ref )
{
curl_setopt($ch, CURLOPT_REFERER, $ref);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
{
$postVars='';
foreach ($post as $option => $value)
{
$postVars .= $option.'='.urlencode($value).'&'; }
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postVars);
}
curl_setopt($ch,CURLOPT_HEADER, 1);
$header[] = 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5';
$header[] = 'Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7';
$header[] = 'Accept-Language: pl,en-us;q=0.7,en;q=0.3';
$header[] = 'Connection: keep-alive';
$header[] = 'Host: <a href="http://sms.priv.pl/';" target="_blank">http://sms.priv.pl/';</a>
$header[] = 'Keep-Alive: 300';
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION, $follow);
$r = curl_exec($ch);
curl_close($ch);
return $r;
}
function send_sms($kier,$nr, $msg, $od)
{
$data=array('status' => 'send','siec' => $kier, 'number2' => $nr, 'tresc' => $msg, 'od' => $od, 'zostalo' => (string
)(412
-strlen($msg)), 'nr' => '', 'mms' => 'off');
$co=curl("http://sms.priv.pl/",$data,"http://sms.priv.pl/");
}
Niestety sms-y nie są wysyłane.