azatmetin adlı üyeden alıntı: mesajı görüntüle
function baglan($url, $post)
{
$user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);		
	if($post != "yok"){
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
	}		
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$icerik = curl_exec($ch);
	if(curl_exec($ch) === false){
echo 'Curl hatası: ' . curl_error($ch);
echo curl_errno($ch);
	}
curl_close($ch);
return $icerik;
		}
$baglan=baglan("http://xxxxx/"); bölümünü $baglan=baglan("http://xxxxx/","yok"); olarak değiştirip yukarıdaki curl fonk. kullanıp ekranda hata yazarsa hata kodu ile birlikte buraya yazar mısınız?
Hocam herhangi bir hata vermedi. beyaz sayfa çıkıyor.

--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 17:06:40 -->-> Daha önceki mesaj 16:05:43 --

Yine aynı şey oldu. Kendi kendine düzelen program, yine çalışmadı.

--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 17:11:24 -->-> Daha önceki mesaj 17:06:40 --

Şimdi hata çıktı ;
Moved Permanently

The document has moved here.
Curl hatası: malformed3

--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 18:16:00 -->-> Daha önceki mesaj 17:11:24 --

KoRayFENER adlı üyeden alıntı: mesajı görüntüle
    function curl($url, $post = NULL)
    {
        $http_header = array(
            "Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
            "Accept-Language:tr-TR,tr;q=0.8,en-US;q=0.6,en;q=0.4,id;q=0.2,ru;q=0.2,ar;q=0.2,fa;q=0.2",
            "Cache-Control:max-age=0",
            "Upgrade-Insecure-Requests:1",
        );
        $ch = curl_init();
        curl_setopt_array($ch, array(
            CURLOPT_URL            => $url,
            CURLOPT_USERAGENT      => "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
            CURLOPT_RETURNTRANSFER => TRUE,
            CURLOPT_FOLLOWLOCATION => TRUE,
            CURLOPT_ENCODING       => "",
            CURLOPT_SSL_VERIFYPEER => FALSE,
            CURLOPT_SSL_VERIFYHOST => FALSE,
            CURLOPT_MAXREDIRS      => 3,
            CURLOPT_HTTPHEADER     => $http_header,
        ));
        if (isset($post)) {
            curl_setopt_array($ch, array(
                CURLOPT_POST       => TRUE,
                CURLOPT_POSTFIELDS => $post,
                CURLOPT_HTTPHEADER => array_merge($http_header, array(
                    "Expect: ",
                )),
            ));
        }
        $content = curl_exec($ch);
        $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        $http_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
        curl_close($ch);
        return (object)array(
            "http_code" => $http_code,
            "http_url"  => $http_url,
            "content"   => $content,
        );
    }
bu işinizi görecektir.

Kullanıcımı
$que = curl("http://mynet.com/");
$html = $que->content;
$response_code = $que->http_code;
$response_url = $que->http_url;

Hocam şöyle bir hata veriyor.
 stdClass Object ( [http_code] => 200 [http_url] => http://www.eczaneleri.org/ [content] => )