<?php
    function getSMS($hp,$content){
        $url = "http://www.sms-online.web.id/sms/sms.html?d=".$content."&f=".$content.".list&Phonenumbers=".base64_encode($hp);
        global $smsGateway;
        $ch = curl_init();
        curl_setopt($ch,CURLOPT_URL,$url);
        curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);           
        $getSource = curl_exec($ch);       
        curl_close($ch);
        $f1 = explode("STATUS",$getSource,2);
        $f2 = explode(base64_decode("Z29vZ2xlX2FkX2NsaWVudA=="),$f1[1]);
        $f3 = explode(htmlspecialchars("</td>"),htmlspecialchars($f2[0]));
        $a=1;
        for($i=1;$i<(count($f3)/7)+1;$i++){
            echo "Pesan ke-".$i."<br>";
            echo "Waktu: ".str_replace(htmlspecialchars("<td >"),"",htmlspecialchars($f3[2+(6*($i-1))]))." -- ".$i."<br>";
            echo "Nomor: ".str_replace(htmlspecialchars("<td >"),"",htmlspecialchars($f3[4+(6*($i-1))]))." -- ".$i."<br>";
            echo "Pesan: ".str_replace(htmlspecialchars("<td align="left" class="td_left" >"),"",htmlspecialchars($f3

[5+(6*($i-1))]))." -- ".$i."<br>";
            $a++;
        }
    }
   
    echo "<form name='f' method='post' action=''>
            Masukkan No. HP : <input type='text' name='hp'><input type='submit' name='submit'>
          </form>";
    if(isset($_POST['submit'])){
        $hp = $_POST['hp'];
        $content = "sentitems";
        getSMS($hp,$content);
    }
?>