Log in

View Full Version : read data file via url ?



taydu
02-11-2009, 09:02 AM
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 ?

Nile
02-11-2009, 11:12 PM
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.

smansakra
02-12-2009, 01:52 AM
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)

Nile
02-12-2009, 01:58 AM
Actually, on second thought you can.

http://localhostr.com/files/62cde9/capture.png

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

Better to use file_get_contents though.