UgurSirin adlı üyeden alıntı: mesajı görüntüle
Merhaba arkadaşlar. preg_match_all yöntemiyle HTTPS olan adreslerden veri çekemiyorum. HTTP adreslerden verileri çok güzel alıyorum ancak HTTPS'den veri alamıyorum. Bu konuda tecrübeli arkadaşlar var mı ?

<?php$
site='http://ugursirin.com.tr/3AxisVeri/1.html';
echo "Merhaba, 3Axis.Co web sitesi verileri çekme botu taramaya başlıyor.".'<br>';

//PARÇALAMA
$format = '@<div class="format">(.*?)</div>@si';
$urunAdi='@<h2 class="post-subject">(.*?)</h2>@si';
$urunResim='@src="(.*?)">@si';
$degismezAdi='@images/(.*?)_thumb.jpg">@si';

//BOT TANIMI
$botara = file_get_contents($site);

//DATA ALMA
preg_match_all($format, $botara, $veriFormati);
preg_match_all($urunAdi, $botara, $veriDetay);
preg_match_all($urunResim, $botara, $veriKucukResimAdresi);
preg_match_all($degismezAdi, $botara, $veriDegismezKaydi);
echo "Veri Dosyası Başlığı: ".$veriDetay[1][0].'<br>';
echo "Veri Dosyası Değişmez Kayıt Kodu: ".$veriDegismezKaydi[1][0].'<br>';
echo "Veri Dosyası Türü: ".$veriFormati[1][0].'<br>';
echo "Veri Dosyası Küçük Resim Bağlantı Adresi: ".$veriKucukResimAdresi[1][0].'<br>';
?>
Merhaba,

Hocam file_get_contents yerine aşağıdaki fonksiyonu kullanırsan sorun olmaz.

function GetPage($url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_REFERER, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
}