• 04-01-2024, 23:57:52
    #1
    Test
    Bir PHP İletişim formum var html post ile örneğin iletisim.php ye haber gönderiyor telegram ile bana iletiyor ve gönderende Teşekkürler Mesajınız başarıyla gönderilmiştir ya da Malesef bir hata oluştu daha sonra tekrar deneyiniz bildirisi çıkarmak istiyorum yardımcı olabilecek var mı?
  • 04-01-2024, 23:58:53
    #2
    Hocam iletisim.php kodlarını paylaşır mısınız?
  • 05-01-2024, 00:03:23
    #3
    Detayları PM gönderin yardımcı olayım
  • 05-01-2024, 00:05:04
    #4
    https://www.r10.net/ucretsiz-scriptl...ildirimli.html bir arkadaş paylaşmıştı
  • 05-01-2024, 16:13:58
    #5
    Bir üstteki mesajda paylaşılan scriptten aldım, içeriğini kendine göre düzenleyip kullanabilirsin.

    Kendi verilerine göre değiştireceğin alanlar:
    $adsoyad,$eposta,$konu,$mesaj,$token,$chat_id

    Başka değişiklik yapmazsan çalışır. Test ettim.
    Tabii bunun için önce bir bot oluşturmalı,botun ayarlarından grup sohbetine açmalı ve aldığın token ve chat id parametrelerini girmen gerek.
    Ayrıca localhost'ta SSL problemi yaşadım, sunucuda bir sorun olmadı, bilgine.
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>İletişim Formu</title>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
        <link rel="stylesheet" href="styles.css">
        <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
    </head>
    <body>
    
    <?php
    
    //Gelen verileri tanıyoruz.
    $adsoyad = $_POST['adsoyad'];
    $eposta = $_POST['eposta'];
    $konu = $_POST['konu'];
    $mesaj = $_POST['mesaj'];
    
    
    // Telegram'a bildirim gönderme işlemi
    $token = 'TOKEN';
    $chat_id = 'CHAT_ID';
    $message_text = "Yeni mesaj!\n\nAd Soyad: $adsoyad\nE-posta: $eposta\nKonu: $konu\nMesaj: $mesaj";
    
    
    $telegram_url = "https://api.telegram.org/bot$token/sendMessage";
    $telegram_params = [
        'chat_id' => $chat_id,
        'text' => $message_text
    ];
    
    $ch = curl_init($telegram_url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $telegram_params);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    curl_close($ch);
    
    // Bildirim gönderildiğini kontrol et
    if ($response === false) {
        echo "Bildirim gönderme hatası: " . curl_error($ch);
    } else {
        // SweetAlert ile uyarı göster
        echo "<script>
                swal('Mesajınız Gönderildi', 'Teşekkür ederiz!', 'success')
                .then((value) => {
                    window.location.href = 'index.php'; // Anasayfaya yönlendir
                });
              </script>";
    }
    ?>
    
    
    
        <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
        <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
    </body>
    </html>
  • 05-01-2024, 16:17:17
    #6
    Test
    dgknbzglu adlı üyeden alıntı: mesajı görüntüle
    Bir üstteki mesajda paylaşılan scriptten aldım, içeriğini kendine göre düzenleyip kullanabilirsin.

    Kendi verilerine göre değiştireceğin alanlar:
    $adsoyad,$eposta,$konu,$mesaj,$token,$chat_id

    Başka değişiklik yapmazsan çalışır. Test ettim.
    Tabii bunun için önce bir bot oluşturmalı,botun ayarlarından grup sohbetine açmalı ve aldığın token ve chat id parametrelerini girmen gerek.
    Ayrıca localhost'ta SSL problemi yaşadım, sunucuda bir sorun olmadı, bilgine.
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>İletişim Formu</title>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
        <link rel="stylesheet" href="styles.css">
        <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
    </head>
    <body>
    
    <?php
    
    //Gelen verileri tanıyoruz.
    $adsoyad = $_POST['adsoyad'];
    $eposta = $_POST['eposta'];
    $konu = $_POST['konu'];
    $mesaj = $_POST['mesaj'];
    
    
    // Telegram'a bildirim gönderme işlemi
    $token = 'TOKEN';
    $chat_id = 'CHAT_ID';
    $message_text = "Yeni mesaj!\n\nAd Soyad: $adsoyad\nE-posta: $eposta\nKonu: $konu\nMesaj: $mesaj";
    
    
    $telegram_url = "https://api.telegram.org/bot$token/sendMessage";
    $telegram_params = [
        'chat_id' => $chat_id,
        'text' => $message_text
    ];
    
    $ch = curl_init($telegram_url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $telegram_params);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    curl_close($ch);
    
    // Bildirim gönderildiğini kontrol et
    if ($response === false) {
        echo "Bildirim gönderme hatası: " . curl_error($ch);
    } else {
        // SweetAlert ile uyarı göster
        echo "<script>
                swal('Mesajınız Gönderildi', 'Teşekkür ederiz!', 'success')
                .then((value) => {
                    window.location.href = 'index.php'; // Anasayfaya yönlendir
                });
              </script>";
    }
    ?>
    
    
    
        <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
        <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
    </body>
    </html>
    Evet bu form dün işime yaradı sadece wordpress için html dönüştürmem gerekti herkese desteği için teşekkür ederim