Вход Регистрация
Файл: 3020.ru/_core/_class/curl.php
Строк: 67
<?php
    
//3020.ru - скрипты скачать можно тут
    # класс curl
    # author penny wise
    # telegram @the_penny_wise

    
class curl {

        function 
get($url,$tpage,$post = null){   # подключение по curl к сайту

        
$curl = curl_init();  
        
$ua = 'Nokia 6230';    
        
$headers = array(
        
'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
        
'Accept-Language:ru,en-US;q=0.8,en;q=0.6,uk;q=0.4',
        
'Referer:' . $url,$ua);
        
curl_setopt($curl, CURLOPT_URL, $url);  
        
curl_setopt($curl, CURLOPT_USERAGENT, $ua);  
        
curl_setopt($curl, CURLOPT_REFERER, $url);  
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);  
        
curl_setopt($curl, CURLOPT_TIMEOUT, 60); 
        
curl_setopt($curl, CURLOPT_COOKIEJAR, cache.'_cookies/'.$tpage.'.dat');
        
curl_setopt($curl, CURLOPT_COOKIEFILE, cache.'_cookies/'.$tpage.'.dat');
        
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
        
curl_setopt($curl, CURLOPT_HEADER, 1);
        if(
$post != null) :
        
curl_setopt($curl, CURLOPT_POST, 1);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
        endif;
        
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
        
$cnt = curl_exec($curl);  
        
curl_close($curl); 
        return 
$cnt;  
    
        }  
    

        function 
img($url){ # подключаемся к изображению

        
header('Content-Type: image/jpeg');
            
        print 
file_get_contents(base64_decode($url));
    
        }    

        function 
files($url){

        
$file = base64_decode($url);  
        
$url = base64_decode($url);  

        
$finfo = new SplFileInfo($file);  
        
$fn = $finfo->getFilename();  
        if (
$h = get_headers($url, 1)):  
        if (!empty(
$h['Location'])):  
        
$url = $h['Location'];  
        
$h = get_headers($url, 1);  
        endif;  
        if (
ob_get_level())  
        
ob_end_clean();  

        
header('Content-Description: File Transfer'); 
        
header('Content-Type: application/octet-stream'); 

        
header('Content-Disposition: attachment; filename='.$_SERVER['HTTP_HOST'].'_'.str_replace('spcs.me','',preg_replace('|?real=(.*?)xyz-1|is', '', $fn)));  

        
header('Content-Transfer-Encoding: binary'); 
        
header('Expires: 0'); 
        
header('Cache-Control: must-revalidate'); 
        
header('Pragma: public'); 
        
header('Content-Length: '.$h['Content-Length']); 
        
readfile($file) . exit;  
        else:  
        
header('location: ' . $file) . exit;  
        endif;
        }

    } 

?>
Онлайн: 1
Реклама