Connection timed out

xadrieth

New Member
Messages
62
Reaction score
1
Points
0
Well, 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.
 

hsr_sr

New Member
Messages
23
Reaction score
0
Points
0
Well, 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.
its PHP code
and it works like a charm for my friend on chopin


wAT shuld i change in this?

Code:
$file_contents = file_get_contents($filename);
Edit:
If 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.
leave 1 try 2 i said
 
Last edited:

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
leave 1 try 2 i said
Woops, didn't read the post completely, my bad!

Anyways, as xadrieth mentionned, file_get_contents streams are blocked. Basically, your best option would be to learn AJAX and JavaScript and do all what the PHP code does in JavaScript.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
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. .


Wrong. Wrong. Wrong.

This page

uses this script:

PHP:
<?php
 
$stuff = file_get_contents( 'http://api.erepublik.com/v1/feeds/citizens/2' ) ;
echo " $stuff " ;
?>

I am on Chopin.
 

hsr_sr

New Member
Messages
23
Reaction score
0
Points
0
what is shown is the above post is true it works for my friend on chopin and not on me on starka
Edit:
should i send a support ticket?
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Well, some admin should look into this. If the free servers are configured differently from each other, how can people know what is what?
 

hsr_sr

New Member
Messages
23
Reaction score
0
Points
0
it was working b4 the downtime
now what should i do most of my scripts are based on this and my site iss based on these scripts
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
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
 

hsr_sr

New Member
Messages
23
Reaction score
0
Points
0
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

still no results now no connection time out error thanks for the attempt though
Edit:
some admin plz reply it worked b4 the starka - apache problem i need this script to work as i have mentioned b4 or i have to find a new host even though i am happy with x10 but i rally need this function
Edit:
this is unfair it works on chopin but not on starka
Edit:
does other servers allow this ie stoli , chopin , lotus

will this be solved if i create a new acc on a different server?
 
Last edited:
Top