Показать сообщение отдельно

  #4  
Старый 08.08.2008, 13:23
Isis
Флудер
Регистрация: 20.11.2006
Сообщений: 3,315
С нами: 10248806

Репутация: 2371


По умолчанию

PHP код:
<?php
    set_time_limit
(0);
    
ob_start();
    
ob_implicit_flush(0);

    
$url    = 'http://freehost.com.ua/about/cat/';
    
$post    = 'sb=Голосовать&cat[]=345';
    
$file    = file('proxy.txt');
    
$prox    = explode(':', $file[0]);
    
$proxy    = $prox['0'];
    
$port    = $prox['1'];

    
$ct        = curl_init();
    
curl_setopt($ct, CURLOPT_URL, $url);
    
curl_setopt($ct, CURLOPT_RETURNTRANSFER, 1);
    
curl_setopt($ct, CURLOPT_HEADER, 1);
    
curl_setopt($ct, CURLOPT_REFERER, $url);
    
curl_setopt($ct, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
    
curl_setopt($ct, CURLOPT_FOLLOWLOCATION, 1);
    
curl_setopt($ct, CURLOPT_PROXY, $proxy.':'.$port);
    
$cont = curl_exec($ct);
    
curl_close($ct);

    
$newp    = str_replace($proxy.':'.$port, '', file_get_contents('proxy.txt'));
    if(
$prf    = fopen('proxy.txt', 'w+'))
    {
        
fwrite($prf, $newp);
        
fclose($prf);
        echo 
'Меняем proxy...<br/>';
        
$contents = ob_get_contents () ;
        
ob_end_clean() ;
        print 
$contents;
        echo 
'<script type="text/javascript">location.href="index.php"</script>';
    }
    else
    {
        
'Сменить proxy не удалось<br/>';
    }
?>
 
Ответить с цитированием