For security reasons this function has been disabled on my server (As my sys admin said) but I really want this function on my script, So is there any function alternative it ? cURL or fopen.

if you could please convert it to the alternative function will be much appreciated 🙂

$read = file_get_contents('http://www.google.com/');
echo $read;
    2CODE wrote:

    For security reasons this function has been disabled on my server (As my sys admin said) but I really want this function on my script, So is there any function alternative it ?

    What are the security reasons cited? Chances are, they apply to whatever alternative there is, or they are simply delusional to begin with.

    2CODE wrote:

    cURL or fopen.

    Clearly, you have some idea of possible alternatives. Try them.

      I would expect it more likely not that the function itself was disabled (though it is possible to do so), but rather that the allow_url_fopen setting is turned off, disabling the use of URL's in file functions. If that is the case, the the cURL functions would be the most likely substitute -- assuming that extension has not been disabled.

        Thanks, Could you please laserlight to convert the above file_get_contents code to cURL or fopen function ? Thanks in advance.

          2CODE;10973945 wrote:

          Thanks, Could you please laserlight to convert the above file_get_contents code to cURL or fopen function ? Thanks in advance.

          while you wait, how about reading the manual and trying yourself.

            I done it with cURL
            but unfortunate, URL file-access is disabled from my server and also curl, Looks like I'll move hosts and use cURL or file_get_contents.

              Congratulations on sorting it. Don't forget to mark your thread resolved.

                Write a Reply...