• 01-04-2013, 11:57:42
    #1
    Warning: file_get_contents() [function.file-get-contents]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/celmakyapi.com.tr/httpdocs/index.php on line 225
    
    Warning: file_get_contents(http://www.tcmb.gov.tr/kurlar/today.xml) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/celmakyapi.com.tr/httpdocs/index.php on line
    hatası Alıyorum localde çalışan kod Sunucuda hata veriyor
  • 01-04-2013, 12:42:17
    #2
    sevimliseytan adlı üyeden alıntı: mesajı görüntüle
    Warning: file_get_contents() [function.file-get-contents]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/celmakyapi.com.tr/httpdocs/index.php on line 225
    
    Warning: file_get_contents(http://www.tcmb.gov.tr/kurlar/today.xml) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/celmakyapi.com.tr/httpdocs/index.php on line
    hatası Alıyorum localde çalışan kod Sunucuda hata veriyor
    allow_url_fopen degeri 1 olmasi lazim curl kullanmayi deneyin:

    function curl($url, $post=false)
    {
        $user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6';
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, $post ? true : false);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post ? $post : false);
        curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
        $icerik = curl_exec($ch);
        curl_close($ch);
        return $icerik;
    }