Request Newbie Mong được giúp đỡ

Tình hình là em có 1 code cũ về shop socks nhưng vì cũng nâu ko dùng lên giờ up lên host thì lại lỗi mất hàm get socks trong file addsocks bởi khí add socks vào thì lại ko hiện rõ info của socks mà toàn báo Unknown
2.gif


Ví Dụ : em có 1 em socks live khi check socks hiện đủ info như :

Host Name , Zip Code , City , State , Country


để em up cái hình cho các bác dễ hiểu :

fRrzuxE.png


còn đây là đoạn code lỗi em đang dùng :

Code:
<?
if ($checkLogin) {
    set_time_limit(0);
Global $socks_list,$site,$sockstimeout,$paypaltimeout,$listlive,$Live;
$socks_list = $_POST["sockslist"];
$site = $_POST["site"];
if (strlen($site)<1) {$site = "http://google.com";}
$sockstimeout = $_POST["sockstimeout"];
if (!isset($sockstimeout)) {$sockstimeout = 5;}
$paypaltimeout = $_POST["paypaltimeout"];
if (!isset($paypaltimeout)) {$paypaltimeout = 10;}
if (strlen($socks_list)<1) {$socks_list = "173.217.199.190:27977\n173.27.84.230:27977\n174.60.180.218:27977\n24.126.198.70:27977\n24.128.33.61:27977\n";}
if($_POST["submit"]){
    function delete_cookies(){
        global $config;
        $fp = @fopen($config['cookie_file'],'w');
        fwrite($fp, "");
        @fclose($fp);    
    }
    function curl($url)
    {
        $ch = curl_init(); 
        curl_setopt($ch, CURLOPT_URL, $url);  // The URL to fetch. You can also set this when initializing a session with curl_init().  
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_REFERER, $url);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        $result = curl_exec($ch);  // grab URL and pass it to the variable.  
        curl_close($ch);  // close curl resource, and free up system resources.   
        return $result; // Print page contents. 
    }
    Function getsocks($list)
    {
        preg_match_all("/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}[:|-\s\/]\d{1,7}/", $list, $socks);
        $socks = array_unique($socks[0]);
        $socks2 = array();
        For ($i=0;$i<count($socks);$i++)
        {
            If (strlen($socks[$i]) > 7) $socks2[] = str_replace(array("|", "/", " ", "-"),':',$socks[$i]);
        }
        Return $socks2;
    }
    $socks_list = str_replace(" ",":",$socks_list);
    $socks_list = str_replace("|",":",$socks_list);
    $socks_list = str_replace("/",":",$socks_list);
    $AllSocks = getsocks($socks_list);
    $All = count($AllSocks);
    $socks_list = "";
    For ($i = 1; $i <= $All; $i++)
    {
        $socks_list .= $AllSocks[$i-1]."\n";
    }
}
?>
<br>
<br>
<h4 class="green">Check Socks 5 Live & Blacklist Paypal</h4>
<form action="" method="post">
<textarea name="sockslist" cols="70" rows="10" onclick="this.select()"><?=$socks_list?></textarea><br>
<input type="hidden" name="act" value="go" />
<br>
<p class="green">Clear Paypal: <input type="checkbox" id="clear" value="1" name="clear" checked />
<input type="submit" id="submit" value="Add Sock" name="submit" /></p>
</form>
<?
if($_POST["submit"]){
    function getbetween($content,$start,$end){
        $r = explode($start, $content);
        if (isset($r[1])){
            $r = explode($end, $r[1]);
            if ($r[0] == '') return 'Unknown';
            return $r[0];
        }
        return 'Unknown';
    }
    function in_string($needle, $haystack, $insensitive = 0) {
    if ($insensitive) {
            return (false !== stristr($haystack, $needle)) ? true : false;
        } else {
            return (false !== strpos($haystack, $needle))  ? true : false;
        }
    }
    Function Check($Socks,$site,$sockstimeout,$paypaltimeout)
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($curl, CURLOPT_HEADER, true);
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookie.txt');
        curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookie2.txt');
        curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 1);
        if($Socks != "")
        {
        curl_setopt($curl, CURLOPT_PROXY, $Socks);
        curl_setopt($curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
        }
        curl_setopt($curl, CURLOPT_DNS_CACHE_TIMEOUT,1);
        curl_setopt($curl, CURLOPT_TIMEOUT_MS,$sockstimeout);
        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT_MS,$sockstimeout);
        curl_setopt($curl, CURLOPT_TIMEOUT,$sockstimeout);
        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT,$sockstimeout);
        curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
        $site .= "?".microtime();
        curl_setopt($curl, CURLOPT_URL, $site);
        $Exec = curl_exec($curl);
        $info = curl_getinfo($curl);
        If ($Exec)
        {
            $sock['sock_times'] = $info['connect_time'];
            $status = "Live";
        }
        curl_close ($curl);
        If ($status == "Live")
        {
            $sock['sock_ip'] = $Socks;
            $sock['sock_status'] = 0;
            $sock['sock_lastview'] = 0;
                $IP = explode(":",$Socks);
                $PORT = $IP[1];
                $IP = $IP[0];
                
                $longisp = @gethostbyaddr($IP);
                $isp = explode('.', $longisp);
                $isp = array_reverse($isp);
                $tmp = $isp[0];
                if (preg_match("/(org?|com?|net)/i", $tmp)) {
                     $myisp = $isp[1].'.'.$isp[0];
                } else {
                    $myisp = $isp[2].'.'.$isp[1].'.'.$isp[0];
                }
                if (preg_match("/[0-9]{1,3}\.[0-9]{1,3}/", $myisp)) $sock['sock_hostname'] = 'Unknown'; else  $sock['sock_hostname'] = $myisp;
                
                $url = "http://www.geoiptool.com/en/?IP=".$IP;
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, $url);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                curl_setopt($ch, CURLOPT_REFERER, $url);
                $record = curl_exec($ch);
                curl_close ($ch);

            $sock['sock_country'] = trim(strip_tags(getbetween($record,'<td align="right"><span class="arial">Country:</span></td>','</a> <img')));
                if (empty($sock['sock_country'])) $sock['sock_country'] = "Unknown";
            $sock[sock_states] = trim(strip_tags(getbetween($record,'<td align="right"><span class="arial">Region:</span></td>','</td>')));
                if (empty($sock['sock_states'])) $sock['sock_states'] = "Unknown";
            $sock['sock_city'] = trim(strip_tags(getbetween($record,'<td align="right"><span class="arial">City:</span></td>','</td>')));
                if (empty($sock['sock_city'])) $sock['sock_city'] = "Unknown";
            $sock['sock_zip'] = trim(strip_tags(getbetween($record,'<td align="right"><span class="arial">Postal code:</span></td>','</td>')));
                if (empty($sock['sock_zip'])) $sock['sock_zip'] = "Unknown";
                if($_POST["clear"] == 1)
                {
                    $site="http://megaupload.com/?c=premium";
                    $site1 = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&[email protected]&item_name=Lifetime+premium+membership+for+Megaupload.com&item_number=premium+(28470707127)&amount=199.99&no_note=1&lc=US&no_shipping=1&currency_code=USD";
                    $s = curl($site1); 
                    $currentpage = getbetween($s,'s.prop1="','";');
                    if ($s){
                        if((stristr($s,"Choose a PayPal Password")) || (stristr($s,"fieldrow password-create")) || (stristr($s,"Create PayPal Password")) || (preg_match('/Re-enter password/', $s))){
                            Return "Black List";
                        }
                        else{
                            Return $sock;
                        }
                    }
                    else{
                        Return "Time Out";
                    }
                }
                else Return $sock;
        }
        else Return "Die";
    }
    
    Echo "<div><b><i><center>...:: Checking Socks with timeout $sockstimeout s ::...</center></i></b><HR>";
    $j = 0;
    For ($i = 1; $i <= $All; $i++)
    {
        If (strlen($AllSocks[$i-1])>10)
        {
            $Socks = $AllSocks[$i-1];
            $sock = Check($Socks,$site, 5, 5);
            If ($sock == "Die")
            {
            echo "<span class=\"red bold\">".$Socks." => Sock Die.</span><br>";
            }
            elseIf ($sock == "Time Out")
            {
            echo "<span class=\"red bold\">".$Socks." => Sock Time Out.</span><br>";
            }
            elseIf ($sock == "Black List")
            {
            echo "<span class=\"red bold\">".$Socks." => Sock is Black List.</span><br>";
            }
            else if(is_array($sock))
            {
            $j++;
            if($db->query_insert(TABLE_SOCKS, $sock)) {
                                echo "<span class=\"green bold\">".$Socks." => Add Sock successfully.</span><br>";
                            }
                            else {
                                echo "<span class=\"red bold\">".$Socks." => Add Sock error.</span><br>";
                            }            
            }
            flush();
        }
    }
    $Live = $j ;
    $Die = $All - $Live;
    Echo "<HR>";
    Echo "Checked : ".$All." Socks - Socks live: ".$Live." Socks - Socks die: ".$Die." Socks<br>";
}

}
else {
    require("./minilogin.php");
}
?>

các bác nào biết và thiện chí giúp em xin giải thích dưới toppic này hoạc PM yahoo : mr_s0n1986
em rất cảm ơn nhiều
4.gif

 

Announcements

Forum statistics

Threads
427,360
Messages
7,206,407
Members
179,658
Latest member
bet88ytuquemiras

Most viewed of week

Most discussed of week

Most viewed of week

Most discussed of week

Back
Top Bottom