Created
July 15, 2021 15:08
-
-
Save prensmiskin/ae7cccd40f4ce4b2ec3c7c7f4a38a77b to your computer and use it in GitHub Desktop.
smsapi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function XMLPOST($PostAddress,$xmlData) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL,$PostAddress); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml")); | |
curl_setopt($ch, CURLOPT_TIMEOUT, 30); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlData); | |
$result = curl_exec($ch); | |
return $result; | |
} | |
$xml='<?xml version="1.0" encoding="UTF-8"?> | |
<mainbody> | |
<header> | |
<company dil="TR">Netgsm</company> | |
<usercode>delete</usercode> | |
<password>delete</password> | |
<type>1:n</type> | |
<msgheader>delete</msgheader> | |
</header> | |
<body> | |
<msg> | |
<![CDATA[Mesarrrj Metnim]]> | |
</msg> | |
<no>delete</no> | |
<no></no> | |
</body> | |
</mainbody>'; | |
$gelen=XMLPOST('https://api.netgsm.com.tr/sms/send/xml',$xml); | |
echo $gelen; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment