Arkadaşlar merhaba, url deki bir değişkeni çekip yazdırmak istiyoruz ancak halledemedik. Değişkeni sitemizden çekip sms yollatmak için xml e yazdırmak istiyoruz. Kodları aşağıda ilettim. Değerli yardımlarınızı bekliyorum.
Url = Sms.php?mesaj=sms-deneme&numara=0531
SMS XML KODU
<?php
set_time_limit(0);
ini_set('mysql.connect_timeout', 600);
ini_set('default_socket_timeout', 600);
function sendRequest($site_name,$send_xml,$header_type=array('Content-Type: text/xml'))
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$site_name);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$send_xml);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPHEADER,$header_type);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec($ch);
return $result;
}
$xml = "
<SMS>
<oturum>
<kullanici>KULLANICI ADI</kullanici>
<sifre>ŞİFRE</sifre>
</oturum>
<mesaj>
<baslik>BAŞLIK</baslik>
<metin> echo "http://".$_SERVER['HTTP_HOST']."".$_SERVER['REQUEST_URI'].""; </metin>
<alicilar>ALICINUMARASI</alicilar>
</mesaj>
</SMS>";
$gonder = sendRequest("http://www.dakiksms.com//api/xml_api.php",$xml);
die($gonder);
?>