Sms activate get number and read sms PHP

in #utopian-io7 years ago (edited)

Hello guys my name is Sinan Karayaman. I have been working on wordpress and other web services for few years now.

Sms activate get number and read sms PHP sms-activate.ru you can read and read numbers from the system very easily with the API provided by the site.

The script has been designed not to be as complex as possible in order to inspire fellow programmers. You do not need to make any adjustments when integrating into your projects. You can use the function you want and use it directly.

  • Coded functions

file_get_contents ; Reads entire file into a string
preg_match ; Perform a regular expression match
trim ; Strip whitespace (or other characters) from the beginning and end of a string
str_replace ; Replace all occurrences of the search string with the replacement string
explode ; Split a string by string

  • index.php

<?php
error_reporting(0);
$SmsApiKey = 'REPLACE-API-KEY';
include('Fonksiyonlar.php');
 
?>

<!DOCTYPE html>
<html>
<head>
    <title>Numara</title>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>


    <div id="Genel">
        
        <center><a href="index.php?Neresi=NumaraVer" class="numaraVer">Numara Ver</a></center>

    <?php
        if(isset($_GET['Neresi']) && $_GET['Neresi']=='YeniMesaj'){
            $TelefonNumaraID = $_GET['NumaraID'];
            $Baglanti = 'http://sms-activate.ru/stubs/handler_api.php?api_key='.$SmsApiKey.'&action=setStatus&status=3&id='.$TelefonNumaraID.'&forward=0'; // Tekrar Başka Sms Kontrolü
            $Kaynak = file_get_contents($Baglanti);
            if(preg_match('@ACCESS_RETRY_GET@', $Kaynak)){
        ?>

            <div class="numaralar" style="margin-top: 25px;">Numara Yenilendi</div>

        <?php
            }else{
        ?>

            <div class="numaralar" style="margin-top: 25px;">Numara YENİLENEMEDİ</div>

        <?php
            }
        }
        if(isset($_GET['Neresi']) && $_GET['Neresi']=='MesajOku'){
            $TelefonNumaraID = $_GET['NumaraID'];
            $MesajOku = MesajOku($SmsApiKey, $TelefonNumaraID);
            if($MesajOku['Durum']){
                $Sms = $MesajOku['Sms'];
                $Kod = preg_match('@([0-9]+)@', $Sms, $Kod)?end($Kod):false;
                if($Kod){
        ?>

            <div class="numaralar" style="margin-top: 25px;">Mesaj: <?=$Kod?></div>

        <?php
                }else{
        ?>

            <div class="numaralar" style="margin-top: 25px;">Mesaj Bulunamadı</div>

        <?php
                }
            }else{
        ?>

            <div class="numaralar" style="margin-top: 25px;">Mesaj Bulunamadı</div>

        <?php
            }
        }
        if(isset($_GET['Neresi']) && $_GET['Neresi']=='NumaraVer'){
            $YeniNumaraVer = YeniNumaraVer($SmsApiKey);
            $TelefonNumarasi = $YeniNumaraVer['Numara'];
            $TelefonNumaraID = $YeniNumaraVer['ID'];
    ?>

            <div class="numaralar" style="margin-top: 25px;">Telefon Numarası: <span><?=$TelefonNumarasi?></span></div>
            <div class="numaralar" style="margin-bottom: 25px;">Telefon Numarası ID: <span><?=$TelefonNumaraID?></span></div>

            <center><a href="index.php?Neresi=YeniMesaj&NumaraID=<?=$TelefonNumaraID?>" target="_blank" class="numaraVer">Numarayı Yenile</a></center>

            <center><a href="index.php?Neresi=MesajOku&NumaraID=<?=$TelefonNumaraID?>" target="_blank" class="numaraVer">Mesaj Kontrol</a></center>

    <?php
        }
    ?>
    </div>

</body>
</html>

  • functions.php

<?php
 
function MesajOku($SmsApiKey, $ID){
    global $SmsApiKey;
    $Baglanti = 'http://sms-activate.ru/stubs/handler_api.php?api_key='.$SmsApiKey.'&action=getStatus&status=1&id='.$ID.'&forward=0';
    $Kaynak = file_get_contents($Baglanti);
    if(preg_match('@STATUS_OK@', $Kaynak)){
        $Sms = trim(str_replace('STATUS_OK:', '', $Kaynak));
        return array('Durum' => 1, 'Sms' => $Sms);
    }else{
        return array('Durum' => 0);
        
    }
}
function YeniNumaraVer(){
    global $SmsApiKey;
    $Servis = 'go';
    //$Servis = 'ot';
    $Baglanti = 'http://sms-activate.ru/stubs/handler_api.php?api_key='.$SmsApiKey.'&action=getNumber&service='.$Servis.'&forward=0&ref=sinankarayaman';
    $Kaynak = file_get_contents($Baglanti);
    if(preg_match('@ACCESS_NUMBER@', $Kaynak)){
        $NumaraBilgisi = explode(':', str_replace('ACCESS_NUMBER:', '', $Kaynak));
        $ID = $NumaraBilgisi[0];
        $Numara = $NumaraBilgisi[1];
        return array('Durum' => 1, 'ID' => $ID, 'Numara' => $Numara, 'Site' => 'SmsActivate');
    }else{
        return array('Durum' => 0);
    }
}
?>

  • style.css

*{
    font-family: arial;
    font-size: 15px;
}

#Genel{
    width: 250px; 
    margin: auto; 
    padding-top: 25px;
}

.numaraVer{
    padding: 11px 25px; 
    background: #ffefd1; 
    border: 1px dashed #666; 
    color: #2a4685; 
    border-radius: 5px; 
    text-decoration: none; 
    font-weight: bold;
    display: block;
    float: left;
    width: 100%;
    margin-top: 5px;
}
.numaralar{
    padding-top: 3px;
    padding-right: 45px;
    padding-bottom: 5px;
    padding-left: 5px;
    border-bottom: 1px dashed #666; 
    color: #2a4685; 
    font-weight: bold;
    display: block;
    float: left;
    width: 100%;
    margin-top: 5px;
}

  • if you want to get a new number, click 'Numara Ver' button.

1.png

  • You can see a new number.

2.png

  • If you want to change the last number and get a new number, click the 'Numarayı Yenile' button.

3.png

  • If you want to read the message, click 'mesaj control' button.

4.png

  • You can view the incoming message.

5.png

Github url : https://github.com/sinankarayaman/sms-activate-get-number-and-read



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @sinankarayaman I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.028
BTC 58058.49
ETH 2284.09
USDT 1.00
SBD 2.51