1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cannot obtain ThreeTZ mid by file_get_content?

Discussion in 'Frequently Asked Questions' started by admin, Aug 29, 2016.

  1. admin

    admin Administrator Staff Member

    We recently found one of our sites didn't get ThreeTZ mid by API as expected.
    The reason is the site moved to a new server and we didn't find that allow_url_fopen was disabled. After the module enabled, everything is back to normal.

    You can use curl function to do the same trick if you hosting doesn't support allow_url_fopen.
    You can use a custom class like this to replace with file_get_contnet

    For example,
    function curl_get_contents($url)
    {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
    }
     
  2. Sanke2Ghete

    Sanke2Ghete New Member

    Nice Stuff..
     
  3. salenaadam

    salenaadam Member

Share This Page