ChiragJhaveri Posted September 3, 2015 Share Posted September 3, 2015 Hi,I am new to PHP. Usually I use file_get_contents to get the content of the URL. however somehow, I am unable to get content for below website.http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/I used http://onlinecurl.com/ website to look at the result of curl and the response header is HTTP/1.1 200 OK Server: nginx Date: Thu, 03 Sep 2015 02:37:29 GMT Content-Type: text/html; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive X-Powered-By: PHP/5.4.35 Link: <http://fullmovie-hd.com/?p=42820>; rel=shortlink I have tried various different things like using curl, changing init header etc. but nothing worked. Can anyone please help? I am writing a scrapper for Kodi and it will help everyone as it will be free scrapper to use.Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/298035-php-file_get_contents/ Share on other sites More sharing options...
QuickOldCar Posted September 3, 2015 Share Posted September 3, 2015 Not sure what your issue is as it seems to connect fine. They use wordpress and they redirect to pretty urls, usually can just add /feed to the end of urls, only few work like this and the rest go to a custom 404 page. The only useful page they have there is their custom 404 page. http://fullmovie-hd.com/go-to-404-page A person should ask the site owner for permission to scrape information from their site. Personally I don't feel like coding something for kodi, is a waste because this site will be gone soon enough because their content is illegal. Quote Link to comment https://forums.phpfreaks.com/topic/298035-php-file_get_contents/#findComment-1520171 Share on other sites More sharing options...
ChiragJhaveri Posted September 3, 2015 Author Share Posted September 3, 2015 Not sure what your issue is as it seems to connect fine. They use wordpress and they redirect to pretty urls, usually can just add /feed to the end of urls, only few work like this and the rest go to a custom 404 page. The only useful page they have there is their custom 404 page. http://fullmovie-hd.com/go-to-404-page A person should ask the site owner for permission to scrape information from their site. Personally I don't feel like coding something for kodi, is a waste because this site will be gone soon enough because their content is illegal. Hi, Thanks for your reply. Can you please provide the PHP code which you are using to get the website source code in PHP? I tried to use file_get_contents($URL) but returns nothing. So, I must be doing something wrong. I know it will go down soon. Just trying to understand why for some websites normal file_get_contents won't work... Thanks Chirag Quote Link to comment https://forums.phpfreaks.com/topic/298035-php-file_get_contents/#findComment-1520172 Share on other sites More sharing options...
Solution QuickOldCar Posted September 3, 2015 Solution Share Posted September 3, 2015 That server could be blocking your ip. I'm sure curl would work for me as well. Might want to look into DOM, simplexml,and xpath for scraping, or use regex with preg_match or preg_match_all There is also simplehtmldom to make it easier for a beginner. <?php //$url = "http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/";//works //$url = "http://fullmovie-hd.com/?p=42820";//works $url = "fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/";//will fail, requires protocol //add protocol if missing if(!parse_url($url, PHP_URL_SCHEME)){ $url = "http://".$url; } //create a stream context for additional options $context = stream_context_create( array( 'http' => array( 'follow_location' => true, 'timeout' => 15 ) ) ); $html = file_get_contents($url, false, $context); var_dump($http_response_header); var_dump($html); ?> What I saw as source: array(7) { [0]=> string(15) "HTTP/1.1 200 OK" [1]=> string(13) "Server: nginx" [2]=> string(35) "Date: Thu, 03 Sep 2015 07:44:14 GMT" [3]=> string(38) "Content-Type: text/html; charset=UTF-8" [4]=> string(17) "Connection: close" [5]=> string(24) "X-Powered-By: PHP/5.4.35" [6]=> string(55) "Link: <http://fullmovie-hd.com/?p=42820>; rel=shortlink" } string(9915) "<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Jurassic Attack Hindi Dubbed NowVideo – Embed Video Links</title> <meta name="google-site-verification" content="8w6BAQbLzv_qs28Gv9P2w9c_7xGJXa8OQ2jfVahouTw" /> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="pingback" href="http://fullmovie-hd.com/xmlrpc.php"> <link rel="alternate" type="application/rss+xml" title="Embed Video Links » Feed" href="http://fullmovie-hd.com/feed/" /> <link rel="alternate" type="application/rss+xml" title="Embed Video Links » Comments Feed" href="http://fullmovie-hd.com/comments/feed/" /> <script type="text/javascript"> window._wpemojiSettings = {"baseUrl":"http:\/\/s.w.org\/images\/core\/emoji\/72x72\/","ext":".png","source":{"concatemoji":"http:\/\/fullmovie-hd.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.2.4"}}; !function(a,b,c){function d(a){var c=b.createElement("canvas"),d=c.getContext&&c.getContext("2d");return d&&d.fillText?(d.textBaseline="top",d.font="600 32px Arial","flag"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings); </script> <style type="text/css"> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style> <link rel='stylesheet' id='nu-bootstrap-css' href='http://fullmovie-hd.com/wp-content/themes/prose/css/bootstrap.min.css?ver=4.2.4' type='text/css' media='all' /> <link rel='stylesheet' id='nu-genericons-css' href='http://fullmovie-hd.com/wp-content/themes/prose/css/genericons.css?ver=4.2.4' type='text/css' media='all' /> <link rel='stylesheet' id='nu-fonts-css' href='//fonts.googleapis.com/css?family=Karla%3A400%2C700%2C400italic%2C700italic%7CLusitana%3A400%2C700%7CBerkshire+Swash%3A400&subset=latin%2Clatin-ext&ver=20131010' type='text/css' media='all' /> <link rel='stylesheet' id='nu-style-css' href='http://fullmovie-hd.com/wp-content/themes/prose/style.css?ver=4.2.4' type='text/css' media='all' /> <script type='text/javascript' src='http://p.jwpcdn.com/6/11/jwplayer.js?ver=4.2.4'></script> <script type='text/javascript' src='http://fullmovie-hd.com/wp-includes/js/jquery/jquery.js?ver=1.11.2'></script> <script type='text/javascript' src='http://fullmovie-hd.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script> <script type='text/javascript' src='http://fullmovie-hd.com/wp-content/themes/prose/js/bootstrap.min.js?ver=4.2.4'></script> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://fullmovie-hd.com/xmlrpc.php?rsd" /> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://fullmovie-hd.com/wp-includes/wlwmanifest.xml" /> <link rel='prev' title='The One HIndi Dubbed Videoweed' href='http://fullmovie-hd.com/the-one-hindi-dubbed-videoweed/' /> <link rel='next' title='Jurassic Attack Hindi Dubbed Novamov' href='http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-novamov/' /> <meta name="generator" content="WordPress 4.2.4" /> <link rel='canonical' href='http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/' /> <link rel='shortlink' href='http://fullmovie-hd.com/?p=42820' /> <script type="text/javascript">jwplayer.defaults = { "ph": 2 };</script> <script type="text/javascript"> if (typeof(jwp6AddLoadEvent) == 'undefined') { function jwp6AddLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } } </script> </head> <body class="single single-post postid-42820 single-format-standard"> <div id="site-navigation" class="navbar navbar-default navbar-static-top site-navigation" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> </div> <!-- #site-navigation --></div> <div id="site-header" class="container site-header" role="banner"> <div class="site-branding"> <div class="site-title"> <a href="http://fullmovie-hd.com/" title="Embed Video Links" rel="home"> Embed Video Links </a> </div> <div class="site-description">All Movies Embed Video Links</div> </div> <!-- #site-header --></div> <div id="main" class="site-main"> <div class="container"> <main id="content" class="site-content" role="main"> <div class="content-area"> <article id="post-42820" class="post-42820 post type-post status-publish format-standard hentry category-uncategorized"> <header class="entry-header"> <div class="entry-meta"> <span class="posted-on"><a href="http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/" title="1:28 am" rel="bookmark"><time class="entry-date published" datetime="2014-03-09T01:28:26+00:00">March 9, 2014</time></a></span> </div> <h1 class="entry-title">Jurassic Attack Hindi Dubbed NowVideo</h1> <div class="entry-meta"> <span class="byline"><span class="author vcard"><a class="url fn n" href="http://fullmovie-hd.com/author/shaimunpvtltd/" title="View all posts by Admin">Admin</a></span></span> <!-- .entry-meta --></div> <!-- .entry-header --></header> <div class="clearfix entry-content"> <!-- Quick Adsense WordPress Plugin: http://quicksense.net/ --> <div style="float:none;margin:10px 0 10px 0;text-align:center;"> <script type="text/javascript" src="http://www.adcash.com/script/java.php?option=rotateur&r=215219"></script> </div> <p style="text-align: center;"><strong>Jurassic Attack Hindi Dubbed NowVideo</strong></p> <p style="text-align: center;"><strong><iframe style="overflow: hidden; border: 0; width: 600px; height: 480px;" src="http://embed.nowvideo.sx/embed.php?width=600&height=480&v=f29946a95646f" height="240" width="320" scrolling="no"></iframe></strong></p> <!-- Quick Adsense WordPress Plugin: http://quicksense.net/ --> <div style="float:none;margin:10px 0 10px 0;text-align:center;"> <script type="text/javascript" src="http://www.adcash.com/script/java.php?option=rotateur&r=215219"></script> </div> <div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div> <!-- .entry-content --></div> <footer class="entry-footer entry-meta"> <span class="cat-links"> <a href="http://fullmovie-hd.com/category/uncategorized/" rel="category tag">Uncategorized</a> </span> <!-- .entry-meta --></footer> <!-- #post-42820 --></article> </div> <!-- #content --></main> </div> <!-- #main --></div> <div id="extra" class="site-extra" role="complementary"> <div class="container"> <div class="row"> </div> </div> <!-- #extra --></div> <footer id="footer" class="site-footer" role="contentinfo"> <div class="container"> <div class="site-info"> © 2015 Embed Video Links. Proudly powered by WordPress. <!-- .site-info --></div> <div class="site-credit"> <a href="http://csthemes.com/theme/prose">Prose</a> by csThemes <!-- .site-credit --></div> </div> <!-- #footer --></footer> </body> <!-- PopAds.net Popunder Code for www.fullmovie-hd.com --> <script type="text/javascript"> var _pop = _pop || []; _pop.push(['siteId', 202458]); _pop.push(['minBid', 0]); _pop.push(['popundersPerIP', 0]); _pop.push(['delayBetween', 0]); _pop.push(['default', false]); _pop.push(['defaultPerDay', 0]); _pop.push(['topmostLayer', false]); (function() { var pa = document.createElement('script'); pa.type = 'text/javascript'; pa.async = true; var s = document.getElementsByTagName('script')[0]; pa.src = '//c1.popads.net/pop.js'; pa.onerror = function() { var sa = document.createElement('script'); sa.type = 'text/javascript'; sa.async = true; sa.src = '//c2.popads.net/pop.js'; s.parentNode.insertBefore(sa, s); }; s.parentNode.insertBefore(pa, s); })(); </script> <!-- PopAds.net Popunder Code End --> <script type="text/javascript" src="http://www.adcash.com/script/java.php?option=rotateur&r=213859"></script> <script type="text/javascript"> var uid = '9499'; var wid = '16485'; </script> <script type="text/javascript" src="http://cdn.popcash.net/pop.js"></script> </html>" Quote Link to comment https://forums.phpfreaks.com/topic/298035-php-file_get_contents/#findComment-1520174 Share on other sites More sharing options...
ChiragJhaveri Posted September 3, 2015 Author Share Posted September 3, 2015 That server could be blocking your ip. I'm sure curl would work for me as well. Might want to look into DOM, simplexml,and xpath for scraping, or use regex with preg_match or preg_match_all There is also simplehtmldom to make it easier for a beginner. <?php //$url = "http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/";//works //$url = "http://fullmovie-hd.com/?p=42820";//works $url = "fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/";//will fail, requires protocol //add protocol if missing if(!parse_url($url, PHP_URL_SCHEME)){ $url = "http://".$url; } //create a stream context for additional options $context = stream_context_create( array( 'http' => array( 'follow_location' => true, 'timeout' => 15 ) ) ); $html = file_get_contents($url, false, $context); var_dump($http_response_header); var_dump($html); ?> What I saw as source: array(7) { [0]=> string(15) "HTTP/1.1 200 OK" [1]=> string(13) "Server: nginx" [2]=> string(35) "Date: Thu, 03 Sep 2015 07:44:14 GMT" [3]=> string(38) "Content-Type: text/html; charset=UTF-8" [4]=> string(17) "Connection: close" [5]=> string(24) "X-Powered-By: PHP/5.4.35" [6]=> string(55) "Link: <http://fullmovie-hd.com/?p=42820>; rel=shortlink" } string(9915) "<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Jurassic Attack Hindi Dubbed NowVideo – Embed Video Links</title> <meta name="google-site-verification" content="8w6BAQbLzv_qs28Gv9P2w9c_7xGJXa8OQ2jfVahouTw" /> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="pingback" href="http://fullmovie-hd.com/xmlrpc.php"> <link rel="alternate" type="application/rss+xml" title="Embed Video Links » Feed" href="http://fullmovie-hd.com/feed/" /> <link rel="alternate" type="application/rss+xml" title="Embed Video Links » Comments Feed" href="http://fullmovie-hd.com/comments/feed/" /> <script type="text/javascript"> window._wpemojiSettings = {"baseUrl":"http:\/\/s.w.org\/images\/core\/emoji\/72x72\/","ext":".png","source":{"concatemoji":"http:\/\/fullmovie-hd.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.2.4"}}; !function(a,b,c){function d(a){var c=b.createElement("canvas"),d=c.getContext&&c.getContext("2d");return d&&d.fillText?(d.textBaseline="top",d.font="600 32px Arial","flag"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings); </script> <style type="text/css"> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style> <link rel='stylesheet' id='nu-bootstrap-css' href='http://fullmovie-hd.com/wp-content/themes/prose/css/bootstrap.min.css?ver=4.2.4' type='text/css' media='all' /> <link rel='stylesheet' id='nu-genericons-css' href='http://fullmovie-hd.com/wp-content/themes/prose/css/genericons.css?ver=4.2.4' type='text/css' media='all' /> <link rel='stylesheet' id='nu-fonts-css' href='//fonts.googleapis.com/css?family=Karla%3A400%2C700%2C400italic%2C700italic%7CLusitana%3A400%2C700%7CBerkshire+Swash%3A400&subset=latin%2Clatin-ext&ver=20131010' type='text/css' media='all' /> <link rel='stylesheet' id='nu-style-css' href='http://fullmovie-hd.com/wp-content/themes/prose/style.css?ver=4.2.4' type='text/css' media='all' /> <script type='text/javascript' src='http://p.jwpcdn.com/6/11/jwplayer.js?ver=4.2.4'></script> <script type='text/javascript' src='http://fullmovie-hd.com/wp-includes/js/jquery/jquery.js?ver=1.11.2'></script> <script type='text/javascript' src='http://fullmovie-hd.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script> <script type='text/javascript' src='http://fullmovie-hd.com/wp-content/themes/prose/js/bootstrap.min.js?ver=4.2.4'></script> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://fullmovie-hd.com/xmlrpc.php?rsd" /> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://fullmovie-hd.com/wp-includes/wlwmanifest.xml" /> <link rel='prev' title='The One HIndi Dubbed Videoweed' href='http://fullmovie-hd.com/the-one-hindi-dubbed-videoweed/' /> <link rel='next' title='Jurassic Attack Hindi Dubbed Novamov' href='http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-novamov/' /> <meta name="generator" content="WordPress 4.2.4" /> <link rel='canonical' href='http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/' /> <link rel='shortlink' href='http://fullmovie-hd.com/?p=42820' /> <script type="text/javascript">jwplayer.defaults = { "ph": 2 };</script> <script type="text/javascript"> if (typeof(jwp6AddLoadEvent) == 'undefined') { function jwp6AddLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } } </script> </head> <body class="single single-post postid-42820 single-format-standard"> <div id="site-navigation" class="navbar navbar-default navbar-static-top site-navigation" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> </div> <!-- #site-navigation --></div> <div id="site-header" class="container site-header" role="banner"> <div class="site-branding"> <div class="site-title"> <a href="http://fullmovie-hd.com/" title="Embed Video Links" rel="home"> Embed Video Links </a> </div> <div class="site-description">All Movies Embed Video Links</div> </div> <!-- #site-header --></div> <div id="main" class="site-main"> <div class="container"> <main id="content" class="site-content" role="main"> <div class="content-area"> <article id="post-42820" class="post-42820 post type-post status-publish format-standard hentry category-uncategorized"> <header class="entry-header"> <div class="entry-meta"> <span class="posted-on"><a href="http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/" title="1:28 am" rel="bookmark"><time class="entry-date published" datetime="2014-03-09T01:28:26+00:00">March 9, 2014</time></a></span> </div> <h1 class="entry-title">Jurassic Attack Hindi Dubbed NowVideo</h1> <div class="entry-meta"> <span class="byline"><span class="author vcard"><a class="url fn n" href="http://fullmovie-hd.com/author/shaimunpvtltd/" title="View all posts by Admin">Admin</a></span></span> <!-- .entry-meta --></div> <!-- .entry-header --></header> <div class="clearfix entry-content"> <!-- Quick Adsense WordPress Plugin: http://quicksense.net/ --> <div style="float:none;margin:10px 0 10px 0;text-align:center;"> <script type="text/javascript" src="http://www.adcash.com/script/java.php?option=rotateur&r=215219"></script> </div> <p style="text-align: center;"><strong>Jurassic Attack Hindi Dubbed NowVideo</strong></p> <p style="text-align: center;"><strong><iframe style="overflow: hidden; border: 0; width: 600px; height: 480px;" src="http://embed.nowvideo.sx/embed.php?width=600&height=480&v=f29946a95646f" height="240" width="320" scrolling="no"></iframe></strong></p> <!-- Quick Adsense WordPress Plugin: http://quicksense.net/ --> <div style="float:none;margin:10px 0 10px 0;text-align:center;"> <script type="text/javascript" src="http://www.adcash.com/script/java.php?option=rotateur&r=215219"></script> </div> <div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div> <!-- .entry-content --></div> <footer class="entry-footer entry-meta"> <span class="cat-links"> <a href="http://fullmovie-hd.com/category/uncategorized/" rel="category tag">Uncategorized</a> </span> <!-- .entry-meta --></footer> <!-- #post-42820 --></article> </div> <!-- #content --></main> </div> <!-- #main --></div> <div id="extra" class="site-extra" role="complementary"> <div class="container"> <div class="row"> </div> </div> <!-- #extra --></div> <footer id="footer" class="site-footer" role="contentinfo"> <div class="container"> <div class="site-info"> © 2015 Embed Video Links. Proudly powered by WordPress. <!-- .site-info --></div> <div class="site-credit"> <a href="http://csthemes.com/theme/prose">Prose</a> by csThemes <!-- .site-credit --></div> </div> <!-- #footer --></footer> </body> <!-- PopAds.net Popunder Code for www.fullmovie-hd.com --> <script type="text/javascript"> var _pop = _pop || []; _pop.push(['siteId', 202458]); _pop.push(['minBid', 0]); _pop.push(['popundersPerIP', 0]); _pop.push(['delayBetween', 0]); _pop.push(['default', false]); _pop.push(['defaultPerDay', 0]); _pop.push(['topmostLayer', false]); (function() { var pa = document.createElement('script'); pa.type = 'text/javascript'; pa.async = true; var s = document.getElementsByTagName('script')[0]; pa.src = '//c1.popads.net/pop.js'; pa.onerror = function() { var sa = document.createElement('script'); sa.type = 'text/javascript'; sa.async = true; sa.src = '//c2.popads.net/pop.js'; s.parentNode.insertBefore(sa, s); }; s.parentNode.insertBefore(pa, s); })(); </script> <!-- PopAds.net Popunder Code End --> <script type="text/javascript" src="http://www.adcash.com/script/java.php?option=rotateur&r=213859"></script> <script type="text/javascript"> var uid = '9499'; var wid = '16485'; </script> <script type="text/javascript" src="http://cdn.popcash.net/pop.js"></script> </html>" Really really thanks for your answer. The other problem I found is that when I was reading the webpage which provides me these links had a carriage return at the end. That was the issue for not getting any return using file_get_contents earlier. Minor issue but I think for a person like me its a great learning. Used below code before getting file_get_contents and it worked. (Had to remove carriage returns from the link). $sourceLink = str_replace(array("\r", "\n"), "", $sourceLink); $sourcePageHTML = file_get_contents($sourceLink); Quote Link to comment https://forums.phpfreaks.com/topic/298035-php-file_get_contents/#findComment-1520220 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.