final60 Posted December 23, 2008 Share Posted December 23, 2008 Hey guys I would like to be able to make use of a file used in an mmo I play, the file is: http://su1.ryzom.com:50000/stats/stats.php I'm not 100% sure, but i presume the file contains basic stats and what not that could be displayed on a guild website. But im not sure on the code I could use to call the info from the stats.php file. any suggestions/help greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/138175-calling-info-from-a-file/ Share on other sites More sharing options...
redarrow Posted December 23, 2008 Share Posted December 23, 2008 try file_get_contents(" "). http://uk.php.net/function.file-get-contents Link to comment https://forums.phpfreaks.com/topic/138175-calling-info-from-a-file/#findComment-722268 Share on other sites More sharing options...
ILMV Posted December 23, 2008 Share Posted December 23, 2008 I am not sure if I get your problem 100%, but you cannot use a file on another server natively. For example, if you include that file from another server, what you will receive is what the server returns to you, and not the original PHP file. If you could explain further. Happy Xmas! ILMV Link to comment https://forums.phpfreaks.com/topic/138175-calling-info-from-a-file/#findComment-722270 Share on other sites More sharing options...
final60 Posted December 23, 2008 Author Share Posted December 23, 2008 Thanks for your replys. I was wondering if the file some how generated basic server info. Maybe like logged in users, server up-time etc. That I could some how call to be displayed for users on my website to view? Link to comment https://forums.phpfreaks.com/topic/138175-calling-info-from-a-file/#findComment-722277 Share on other sites More sharing options...
final60 Posted December 23, 2008 Author Share Posted December 23, 2008 I tried using that function you suggested and it brought the following error inside a php block: Parse error: syntax error, unexpected $end in /homepages/24/d92034484/htdocs/sub_ryzom/forum/Sources/PortaMx/Class/php.php(31) : eval()'d code on line 1 Link to comment https://forums.phpfreaks.com/topic/138175-calling-info-from-a-file/#findComment-722285 Share on other sites More sharing options...
Yesideez Posted December 23, 2008 Share Posted December 23, 2008 I would use file() instead when getting a web page from another server. Very simple yet effective. If read in OK the web page would be in a stored array line by line. Check out the manual for info: http://www.php.net/file Link to comment https://forums.phpfreaks.com/topic/138175-calling-info-from-a-file/#findComment-722301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.