its PHP codeWell, when I ran it, it took about half a minute, I got the same page, but telling me that "Line 34 of platoon.php, file_get_contents(): Stream failed".
And seeing that it is trying to reference another website (http://api.erepublik.com/v1/feeds/citizens/2), thats the problem.
x10hosting doesn't allow you to get file contents from other sites, unless your using an "href/rel/src" element in an HTML tag.
$file_contents = file_get_contents($filename);
leave 1 try 2 i saidIf you check correctly, the page you want to add doesn't exist: http://api.erepublik.com/v1/feeds/citizens/1
Try finding the page that works, that might resolve the problem.
Woops, didn't read the post completely, my bad!leave 1 try 2 i said
x10hosting doesn't allow you to get file contents from other sites, unless your using an "href/rel/src" element in an HTML tag.
Anyways, as xadrieth mentionned, file_get_contents streams are blocked. .
<?php
$stuff = file_get_contents( 'http://api.erepublik.com/v1/feeds/citizens/2' ) ;
echo " $stuff " ;
?>
CODE TO CREATE YOUR URL TO CALL
REPLACE CODE LIKE THIS:
$output = file_get_contents( $url );
WITH CODE LIKE THIS:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
CODE PROCESSING XML in $output
You could try
PHP:CODE TO CREATE YOUR URL TO CALL REPLACE CODE LIKE THIS: $output = file_get_contents( $url ); WITH CODE LIKE THIS: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); CODE PROCESSING XML in $output