Jump to content

file_get_contents help


MikeDXUNL

Recommended Posts

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

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

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.