Query to external URL from PHP not working

beginner00777

New Member
Messages
3
Reaction score
0
Points
0
Hi Friends

I'm new to x10 web hosting and I must say its really amazing.

But making a query to an external URL from PHP is not working here. Is it blocked here at x10 ? My PHP code looks like below ...
$requestURL = 'http://abc.zyx.com/test.csv';
$strTemp = file_get_contents($requestURL);
Please help me. Note that its working perfectly on my own PC but the call to external URLs are not going through PHP code @ x10 :(

Thank you.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Does it generate an error? Or just fail silently?

I think that file_get_contents does not work here for URLs.
 

beginner00777

New Member
Messages
3
Reaction score
0
Points
0
Does it generate an error? Or just fail silently?

I think that file_get_contents does not work here for URLs.

I'm getting no errors. It simply silently fails :(
And get around apart from file_get_contents() using PHP here @ x10 ???
I'm trying to get the stock quotes data from yahoo finance.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
@theone48: that thread is completely unrelated. Please stop posting noise.
 

theone48

New Member
Messages
237
Reaction score
7
Points
0
Sorry, stupid question I guess. The guy was asking about PHP though, whatever it means.
 

cybrax

Community Advocate
Community Support
Messages
764
Reaction score
27
Points
0
Hi Friends

I'm new to x10 web hosting and I must say its really amazing.

But making a query to an external URL from PHP is not working here. Is it blocked here at x10 ? My PHP code looks like below ... Please help me. Note that its working perfectly on my own PC but the call to external URLs are not going through PHP code @ x10 :(

Thank you.

Believe that 'descalzo' is correct, free hosting accounts are not allowed to query an external URL using cURL, fopen or file_get_contents. This keeps the amateur site scrapers from causing problems that would otherwise overload the shared server resources. If you can explain why you're tring to pull content from another domain into your own we may be able to suggest an alternative method.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Well, upon further investigation, the function does work (at least on Chopin) and will retrieve www.cnn.com .

So, unless you post the full and complete code you use (including the URL you use), I cannot help further.
 
Top