Şimdi Ara

Php Scriptin Asp Scripte dönüştürülmesi hk.

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
3
Cevap
0
Favori
283
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Merhaba arkadaşlar;

    Aşağıda ki php scripti asp ye çevirdim. Ancak bütün çabalarıma rağmen çalıştıramadım. Acaba php scriptini asp scriptine çevirebilecek var mı;


    Script aşağıda



    Kod

    Yığını:
    <?php class oneSignal {     public $apiKey = ''; // Api Key     private $restApiKey = ''; // Rest Api Key     function __construct()     {         return $this->apiKey;     }     public function sendMessage($messageEn , $url = null)     {         $content = array(             'en' => $messageEn         );         $data = array(             'app_id' => $this->apiKey,             'included_segments' => array('All'),             'contents' => $content,             'url' => $url         );         $data = json_encode($data);         $curl = curl_init();         curl_setopt_array($curl, array(             CURLOPT_URL => 'https://onesignal.com/api/v1/notifications',             CURLOPT_RETURNTRANSFER => TRUE,             CURLOPT_HEADER => FALSE,             CURLOPT_POST => TRUE,             CURLOPT_POSTFIELDS => $data,             CURLOPT_SSL_VERIFYPEER => FALSE,             CURLOPT_HTTPHEADER => array(                 'Content-Type: application/json; charset=utf-8',                 'Authorization: Basic '.$this->restApiKey             ),         ));         $response = curl_exec($curl);         curl_close($curl);         return 'Bildirim Gönderildi.'.$response;     } } Buda form php <?php require 'oneSignal.php'; $oneSignal = new oneSignal(); if($_POST) {     $text = $_POST['text'];     $link = $_POST['link'];     print_r($oneSignal->sendMessage($text, $link));     //print_r($oneSignal->sendMessage('Mesaj' , 'http://www.ogzcakar.net'));     //Gönderilecek Mesaj , Gönderilen Mesaja Tıklandığında Gideceği Adres } ?> <!doctype html> <html lang="en"> <head>     <meta charset="UTF-8">     <title>OneSignal Api</title>     <script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async='async'></script>     <script>         var OneSignal = window.OneSignal || [];         OneSignal.push(["init", {             appId: '<?=$oneSignal->__construct();?>',             autoRegister: false, /* Set to true to automatically prompt visitors */             subdomainName: '', // Uygulamayı oluştururken aldığınız subDomain             notifyButton:             {                 enable: true, /* Required to use the notify button */                 size: 'large', /* One of 'small', 'medium', or 'large' */                 theme: 'default', /* One of 'default' (red-white) or 'inverse" (white-red) */                 position: 'bottom-right', /* Either 'bottom-left' or 'bottom-right' */                 offset: {                     bottom: '0px',                     left: '0px', /* Only applied if bottom-left */                     right: '0px' /* Only applied if bottom-right */                 },                 prenotify: true, /* Show an icon with 1 unread message for first-time site visitors */                 showCredit: false, /* Hide the OneSignal logo */                 text: {                     'tip.state.unsubscribed': 'Abone ol',                     'tip.state.subscribed': "Aramıza Hoş Geldin :)",                     'tip.state.blocked': "Bildirimlerin Engellendi.",                     'message.prenotify': 'Bildirimlere Abone Olmak İçin Tıklayın.',                     'message.action.subscribed': "Aramıza Hoş Geldin :)",                     'message.action.resubscribed': "Abone oldun. Hoşgeldin :)",                     'message.action.unsubscribed': "Abonelikten Ayrıldın.",                     'dialog.main.title': 'OneSignal Api',                     'dialog.main.button.subscribe': 'Abone Ol',                     'dialog.main.button.unsubscribe': 'Abonelikten Ayrıl',                     'dialog.blocked.title': 'Engelli Bildirimler.',                     'dialog.blocked.message': "Follow these instructions to allow notifications:"                 }             }         }]);     </script> </head> <body> <form action="" method ="post">     <input type="text" id="text" name="text" placeholder="Mesaj" />     <input type="text" id="link" name="link" placeholder="Mesajın Gideceği Link" />     <input type="submit" /> </form> </body> </html>







  • İki farklı programlama dilini bilen birini bulmanız biraz zor. Yapmak istediğinizi anlatırsanız geri dönüş alma ihtimaliniz artacaktır.

  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.