+ Reply to Thread
Results 1 to 8 of 8

Thread: Query to external URL from PHP not working

  1. #1
    beginner00777 is offline x10Hosting Member beginner00777 is an unknown quantity at this point
    Join Date
    Sep 2011
    Posts
    3

    Query to external URL from PHP not working

    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 by beginner00777; 09-27-2011 at 02:14 PM.

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Query to external URL from PHP not working

    Does it generate an error? Or just fail silently?

    I think that file_get_contents does not work here for URLs.
    Nothing is always absolutely so.

  3. #3
    beginner00777 is offline x10Hosting Member beginner00777 is an unknown quantity at this point
    Join Date
    Sep 2011
    Posts
    3

    Re: Query to external URL from PHP not working

    Quote Originally Posted by descalzo View Post
    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.

  4. #4
    theone48's Avatar
    theone48 is offline x10 Sophmore theone48 is an unknown quantity at this point
    Join Date
    Jun 2011
    Posts
    221

    Re: Query to external URL from PHP not working

    Hi and welcome beginner.

    descalzo, what in the world is this PHP??? Another member needed some help with it too in the preceding post:

    PHP Mail()
    T1 Need Help? Add me to your friend's list & message anytime!
    If you believe this a good post, please click the star icon below. Thanks!
    Remember, help is only a step away in the forums or on Live Chat.

  5. #5
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Query to external URL from PHP not working

    @theone48: that thread is completely unrelated. Please stop posting noise.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  6. #6
    theone48's Avatar
    theone48 is offline x10 Sophmore theone48 is an unknown quantity at this point
    Join Date
    Jun 2011
    Posts
    221

    Re: Query to external URL from PHP not working

    Sorry, stupid question I guess. The guy was asking about PHP though, whatever it means.
    T1 Need Help? Add me to your friend's list & message anytime!
    If you believe this a good post, please click the star icon below. Thanks!
    Remember, help is only a step away in the forums or on Live Chat.

  7. #7
    cybrax's Avatar
    cybrax is offline x10 Elder cybrax is on a distinguished road
    Join Date
    Aug 2009
    Location
    UK
    Posts
    699

    Re: Query to external URL from PHP not working

    Quote Originally Posted by beginner00777 View Post
    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.
    The code must flow.
    Project 157: Latest UK Jobs direct to your mobile phone
    New Domain under construction: Lovelogic.net
    home for some new projects that we can't keep here ;)


  8. #8
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Query to external URL from PHP not working

    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.
    Nothing is always absolutely so.

+ Reply to Thread

Similar Threads

  1. Which External HDD Should i Buy?
    By focus in forum Computers & Technology
    Replies: 12
    Last Post: 01-30-2011, 01:51 AM
  2. External stylesheet stopped working suddenly?
    By meithan in forum Graphics & Webdesign
    Replies: 2
    Last Post: 07-06-2010, 11:40 PM
  3. PHP SQL Query not working correctly
    By diabolo in forum Programming Help
    Replies: 0
    Last Post: 02-06-2010, 06:40 PM
  4. External HD
    By diabolo in forum Computers & Technology
    Replies: 1
    Last Post: 11-06-2008, 03:17 PM
  5. External CSS
    By Ryuji666 in forum Programming Help
    Replies: 11
    Last Post: 08-08-2008, 02:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers