Allow_URL_FOPEN = ON often causes trouble to the server, but often (at least I think), we need to read something remotely if you set it_url_fopen = OFF, we have no way to read.
Fortunately, we have a good PHP module - CURL. Below I will talk about the way I use CURL remotely with a CURL:
First, allow_url_fopen = ON case:
PHP
$ Str = file_get_contents ("http://www.9cbs.net/");
IF ($ STR! == false) {
// Do Something with The Content
Echo $ STR;
}
?>
Second, the case of allow_url_fopen = OFF:
PHP
$ CH = curl_init ("http://www.9cbs.net/");
CURL_SETOPT ($ Ch, CURLOPT_FOLLOCATION, 1);
CURL_SETOPT ($ CH, CURLOPT_RETURNTRANSFER, 1);
$ Str = curl_exec ($ ch);
IF ($ STR! == false) {
// Do Something with The Content
Echo $ STR;
}
CURL_CLOSE ($ CH);
?>
Remarks: About Allow_URL_FOPEN = ON, please see how to attack common vulnerabilities in the PHP program (below)