Results 1 to 4 of 4

Thread: read data file via url ?

  1. #1
    Join Date
    Sep 2006
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default read data file via url ?

    PHP Code:
    include("text.db.class.php");
    $db = new TextDB("/data.txt");
    $arrGroup $db->get_group(); 
    currently my data file (data.txt) is local, now i want data.txt to be somewhere else (www.somewhere.com/data.txt). It's possible for me to do it via url ?

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    It depends if its going to be on the same server as your including it... If it is you can use the the /home/path (what every your path is) method to get it. If its not on the same server I don't think that you can do it.
    Jeremy | jfein.net

  3. #3
    Join Date
    Aug 2008
    Location
    karanganyar, solo, indonesia
    Posts
    161
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    it's imposible if from other server, as what nile said, you'd better use same server ( i means same domain ) or using /home/path (what every your path is)
    ///////////////////////////////////////////////////
    ///// http://www.mediatutorial.web.id
    ///////////////////////////////////////////////////

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Actually, on second thought you can.



    Open up php.ini(on your server), and look for the above...

    Better to use file_get_contents though.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •