• 17-02-2015, 16:40:48
    #1
    Üyeliği durduruldu
    Merhaba,

    Aşağıdaki kod ile dosya download ediyorum fakat dosya indirme yarıdayken iptal oluyor tahminimce karşı site iptal ediyor olabilir curl ile tarayıcıymış gibi nasıl gösterebilirim bu işlemi?

    <?php 
    $veri = 'https://my.pcloud.com/publink/show?code=XZnCMkZIQfdV9hMg7yTmRjBrsLpzkk3mHV7';
    $islem = file_get_contents($veri);
    preg_match_all('|<div class="publinkResponsive">(.*?)</div>|si',$islem,$fikra123,PREG_SET_ORDER); 	
    for($i=0; $i<=0; $i++) {
    $gelenveri = $fikra123[$i][1];
    }	
    $bol = explode('<a href="',$gelenveri);	
    $bol2 = explode('"',$bol[1]);	
    $veri2 = $bol2[0];	
    header ("Content-type: octet/stream");
    header("Content-Disposition: attachment; filename=" . basename($veri2));
    header("Connection: Keep-Alive");
    ob_clean();
    readfile($veri2);
    ob_end_flush();
    ?>
  • 17-02-2015, 22:48:26
    #2
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
  • 17-02-2015, 23:59:07
    #3
    Üyeliği durduruldu
    MoreMor adlı üyeden alıntı: mesajı görüntüle
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    standartda oturtamıyorum rica etsem benim kodum ile paylaşabilirmisin?
  • 18-02-2015, 00:10:36
    #4
    Dostum bende curlda sıkıntı yaşıyordum mesajına denk geldim istersen sana n11 için curl bağlantısını atayım sende oradan işine yarayanı alırsın 4 gündür kafayı yedirdi bana

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 00:10:36 -->-> Daha önceki mesaj 00:06:27 --

    $link = "nereye bağlantı yapacaksan oranın adresi";
     $postxml = ' buraya post edeceğin bilgiyi gir';
    			$headers = array(//buraya header bilgilerini gir
    						"Content-length: ".strlen($postxml),);
    				$ch = curl_init();
    				curl_setopt($ch, CURLOPT_URL, $link); 
    				curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    				curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    				curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
    				curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    				curl_setopt($ch, CURLOPT_POST, true); 
    				curl_setopt($ch, CURLOPT_POSTFIELDS, $postxml); 
    				curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); 
    				curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    				$response = curl_exec($ch);
    				curl_close ($ch);
    				var_dump($response);
    Yukarısı xml request sistemi için mantığı algılarsan kendin içinde rahatlıkla editleyebilirsin.
  • 18-02-2015, 14:40:30
    #5
    Üyeliği durduruldu
    MoreMor adlı üyeden alıntı: mesajı görüntüle
    Dostum bende curlda sıkıntı yaşıyordum mesajına denk geldim istersen sana n11 için curl bağlantısını atayım sende oradan işine yarayanı alırsın 4 gündür kafayı yedirdi bana

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 00:10:36 -->-> Daha önceki mesaj 00:06:27 --

    $link = "nereye bağlantı yapacaksan oranın adresi";
     $postxml = ' buraya post edeceğin bilgiyi gir';
    			$headers = array(//buraya header bilgilerini gir
    						"Content-length: ".strlen($postxml),);
    				$ch = curl_init();
    				curl_setopt($ch, CURLOPT_URL, $link); 
    				curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    				curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    				curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
    				curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    				curl_setopt($ch, CURLOPT_POST, true); 
    				curl_setopt($ch, CURLOPT_POSTFIELDS, $postxml); 
    				curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); 
    				curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    				$response = curl_exec($ch);
    				curl_close ($ch);
    				var_dump($response);
    Yukarısı xml request sistemi için mantığı algılarsan kendin içinde rahatlıkla editleyebilirsin.

    Teşekkürler sana, bu kod üzerinde siteden nasıl vere çekebilirim örnek verebilecek olan var mı ?
  • 18-02-2015, 16:22:00
    #6
    function getir($url){
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, FALSE); 
    curl_setopt($ch, CURLOPT_NOBODY, FALSE); 
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt ($ch, CURLOPT_REFERER, $url);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');
    curl_setopt($ch, CURLOPT_ENCODING, "");
    curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
    curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
    $rmx = curl_exec($ch);
    curl_close($ch);
    return $rmx;
    }
    ECHO getir('http://www.mynet.com');
    //standart bir curl kullanımı.
  • 18-02-2015, 16:49:01
    #7
    Üyeliği durduruldu
    ufukt51 adlı üyeden alıntı: mesajı görüntüle
    function getir($url){
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, FALSE); 
    curl_setopt($ch, CURLOPT_NOBODY, FALSE); 
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt ($ch, CURLOPT_REFERER, $url);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');
    curl_setopt($ch, CURLOPT_ENCODING, "");
    curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
    curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
    $rmx = curl_exec($ch);
    curl_close($ch);
    return $rmx;
    }
    ECHO getir('http://www.mynet.com');
    //standart bir curl kullanımı.
    Hocam çok teşekkürler fakat şunu soruyorum bu sistemde ben curl ile ziyaret ettiğim URL yi readfile($link); olarka nasıl kullancağım?
  • 18-02-2015, 19:50:42
    #8
    Hocam sorunuz değişmiş ama ilk sorun bence tarayıcıdan değil, curl timeout süresindendir.
  • 18-02-2015, 22:58:51
    #9
    Üyeliği durduruldu
    Seyranli adlı üyeden alıntı: mesajı görüntüle
    Hocam sorunuz değişmiş ama ilk sorun bence tarayıcıdan değil, curl timeout süresindendir.
    ilk sorumda curl kullanmadan yapıyorum : ) varmıdır başka