Netgsm entegrasyon yardim
5
●118
- 19-04-2022, 13:24:33Laravel: https://github.com/tarfin-labs/netgsm
PHP: https://github.com/phpuzem/netgsm
Yazılımcınız entegre edebilir hocam - 19-04-2022, 13:27:44php hocamsuatbuyukboz adlı üyeden alıntı: mesajı görüntüle
<div class="col-lg-12"> <div class="card"> <div class="card-header justify-content-between d-flex align-items-center"> <h4 class="card-title">NetGSM Ayarları</h4> </div><!-- end card header --> <?php $netgsm = json_decode($settings['netgsm']); ?> <div class="card-body"> <form method="post" enctype="multipart/form-data"> <?php if($_POST['kaydet']){ $netgsm = [ 'header' => $_POST['header'], 'username' => $_POST['username'], 'password' => $_POST['password'], 'ilkmesaj' => $_POST['ilkmesaj'], 'sonmesaj' => $_POST['sonmesaj'] ]; $guncelle = $vt->guncelle('0', 'ayarlar', 'netgsm', '', array(json_encode($netgsm))); if($guncelle){ echo '<div class="alert alert-success" style="padding:5px;">NetGSM Entegrasyonu güncellenmiştir.</div>'; }else{ echo '<div class="alert alert-success" style="padding:5px;">NetGSM Entegrasyonu güncellenmiştir.</div>'; } } ?> <div class="mb-3 row"> <label for="example-text-input" class="col-md-2 col-form-label">SMS Başlığı</label> <div class="col-md-10"> <input class="form-control" type="text" name="header" id="example-text-input" required="" value="<?=$netgsm->header?>"> </div> </div><!-- end row --> <div class="mb-3 row"> <label for="example-text-input" class="col-md-2 col-form-label">Kullanıcı Adı</label> <div class="col-md-10"> <input class="form-control" type="text" name="username" id="example-text-input" required="" value="<?=$netgsm->username?>"> </div> </div><!-- end row --> <div class="mb-3 row"> <label for="example-text-input" class="col-md-2 col-form-label">Şifre</label> <div class="col-md-10"> <input class="form-control" type="text" name="password" id="example-text-input" required="" value="<?=$netgsm->password?>"> </div> </div><!-- end row --> <div class="mb-3 row"> <label for="example-text-input" class="col-md-2 col-form-label">İlk Mesaj</label> <div class="col-md-10"> <input class="form-control" type="text" name="ilkmesaj" id="example-text-input" required="Sayın müşterimiz. " value="<?=$netgsm->ilkmesaj?>"> </div> </div><!-- end row --> <div class="mb-3 row"> <label for="example-text-input" class="col-md-2 col-form-label">Son Mesaj</label> <div class="col-md-10"> <input class="form-control" type="text" name="sonmesaj" id="example-text-input" required="tutarında bir borcunuz bulunmaktadır." value="<?=$netgsm->sonmesaj?>"> </div> </div><!-- end row --> <input type="submit" name="kaydet" class="btn btn-success" value="Kaydet"> </form> </div><!-- end row --> </div></div>
- 19-04-2022, 13:35:20Php bilgim yok hocam ama php bilen bir arkadaş ben yaparım derse yardımcı olabilirim. Tek bir url ye http get yapacak sms otomatik gönderiliyor zaten. Dökümantasyon da oldukça basit neden yapamadı arkadaş şaşırdım.
- 19-04-2022, 13:57:47Yazılımcınıza aşağıdaki kodları verin yapacaktır.
function NETGSMMesajGonder($mesaj,$telefon){
$netgsmuser='BILGIYAZILACAK';
$netgsmpass='BILGIYAZILACAK';
$netgsmtitle='BILGIYAZILACAK';
$xmlData='<?xml version="1.0" encoding="UTF-8"?>
<mainbody>
<header>
<company dil="TR">Netgsm</company>
<usercode>'.$netgsmuser .'</usercode>
<password>'.$netgsmpass .'</password>
<type>1:n</type>
<msgheader>'.$netgsmtitle .'</msgheader>
</header>
<body>
<msg>
<![CDATA['.$mesaj.']]>
</msg>
<no>90'.$telefon.'</no>
</body>
</mainbody>';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://api.netgsm.com.tr/sms/send/xml');
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);
$sonuc=explode(" ", $result);
return $sonuc[0];
}
$mesaj='BILGIYAZILACAK';
$telefon='BILGIYAZILACAK';
$gelen=NETGSMMesajGonder ($mesaj,$telefon);
if($gelen=="00"){
echo 'SMS gönderilmiştir.';
}