MikeDXUNL Posted June 2, 2008 Share Posted June 2, 2008 I am trying to get the source of a site using ASPX (ie) <?php $location = urlencode("http://live.xbox.com/en-US/profile/Achievements/ViewAchievementDetails.aspx?compareTo=pscloud&tid=%09%5D;cn-n7%07%04"); $content = file_get_contents($location); print $content; ?> I get this error, however: Warning: file_get_contents(http%3A%2F%2Flive.xbox.com%2Fen-US%2Fprofile%2FAchievements%2FViewAchievementDetails.aspx%3FcompareTo%3Dpscloud%26tid%3D%2509%255D%3Bcn-n7%2507%2504) [function.file-get-contents]: failed to open stream: No such file or directory in C:\wamp\www\achunlocked\test.php on line 6 Any help? Thanks in advance. - Mike Link to comment https://forums.phpfreaks.com/topic/108434-file_get_contents-help/ Share on other sites More sharing options...
discomatt Posted June 2, 2008 Share Posted June 2, 2008 You don't want to use URLENCODE there $location = "http://live.xbox.com/en-US/profile/Achievements/ViewAchievementDetails.aspx?compareTo=pscloud&tid=%09%5D;cn-n7%07%04"; Link to comment https://forums.phpfreaks.com/topic/108434-file_get_contents-help/#findComment-555894 Share on other sites More sharing options...
MikeDXUNL Posted June 2, 2008 Author Share Posted June 2, 2008 I tried it with and without URLENCODE but here is the error without URLENCODE Warning: file_get_contents(http://live.xbox.com/en-US/profile/Achievements/ViewAchievementDetails.aspx?compareTo=pscloud&tid=%09%5D;cn-n7%07%04) [function.file-get-contents]: failed to open stream: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? in C:\wamp\www\achunlocked\test.php on line 6 Link to comment https://forums.phpfreaks.com/topic/108434-file_get_contents-help/#findComment-555895 Share on other sites More sharing options...
discomatt Posted June 2, 2008 Share Posted June 2, 2008 PHP answered this for you http://www.google.ca/search?q=Unable+to+find+the+socket+transport+%22ssl%22 Link to comment https://forums.phpfreaks.com/topic/108434-file_get_contents-help/#findComment-555899 Share on other sites More sharing options...
MikeDXUNL Posted June 3, 2008 Author Share Posted June 3, 2008 Alright, I got it working, but it doesnt print the code. it just leads me to a Xbox sign in? Any clue why the code is not printing..? Link to comment https://forums.phpfreaks.com/topic/108434-file_get_contents-help/#findComment-556180 Share on other sites More sharing options...
MikeDXUNL Posted June 3, 2008 Author Share Posted June 3, 2008 I tried using cURL <?php $ch = curl_init(); $timeout = 0; $ext = URLENCODE('&tid=%09%5D;cn-n7%07%04'); curl_setopt ($ch, CURLOPT_URL, 'http://live.xbox.com/en-US/profile/Achievements/ViewAchievementDetails.aspx?compareTo=pscloud'.$ext.''); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); // display file print_r($file_contents);?> But get, as a response on "test.php": Object Moved Here with a link to Live Login page. ssl and curl are both enabled in my php. i also tried tricking the page to thinking I'm logged in, but no luck. Help? Thanks in advance. - Mike Link to comment https://forums.phpfreaks.com/topic/108434-file_get_contents-help/#findComment-556196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.