how can i solve this error.file_get_contents(http://www.example.com/name/j/92801): failed to open stream: HTTP request failed! HTTP/1.1 416 Requested Range Not Satisfiable in line
Here is php file code.echo $file = file_get_contents("http://www.example.com/name/j/92801");
I am using wamp server 2.4
first of all is allow_url_fopen
enabled on your php.ini file? and second of all its better to use CURL heres a little function to help you
function curl($url , $ua = FALSE){
if($ua == false){
$ua = $_SERVER['HTTP_USER_AGENT'];
}
$ch = curl_init();
curl_setopt($ch , CURLOPT_URL , $url);
curl_setopt($ch , CURLOPT_RETURNTRANSFER , true);
curl_setopt($ch , CURLOPT_FOLLOWLOCATION , true);
curl_setopt($ch , CURLOPT_USERAGENT , $ua);
return curl_exec($ch);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With