<?php $url = "http://www.google.com"; $content = file_get_contents($url); echo $content; ?>but when i try this code with the different url it dosnt work:
<?php $url = "https://www.novaworld.com/Players/Stats.aspx?id=33680801261&p=616065"; $content = file_get_contents($url); echo $content; ?>When i first started using this code on my local server I hade a problem with this also, and the issue was that https wasnt a registered stream, but i installed OpenSSL and it worked fine on my local server, however even on my remote server https is a registered stream and OpenSSL is installed. I then thought that novaworld.com may bock my from using file_get_conents (possable?). So rather than using file_get_contents I used a curl script to do the same thing.
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.novaworld.com/Players/Stats.aspx?id=33680801261&p=616065"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); ?>Much to my dismay that didnt work either. Finally i did a #curl https://www.novaworl...801261&p=616065
on my linux box i get:
<html><head><title>Object moved</title></head><body><ht>Object moved to <a href='/Players/Search.aspx'>here</a>.</h2></body></html>
Could this be a cookie issue even though i dont go through 2 pages? Someone also mentioned they may filter the user-agent in requests. I have no idea what they are or how to combat that, but surley there is a way to connect to that website.
I welcome all help.
Thank you for taking your time to read this.