ok, i try to explain this one more time:
Local server
script.php **tries to get content of the www.xx.com/foo.txt
foo.txt
Public server
script.php **tries to get content of the 82.82.82.82/foo.txt
foo.txt
- if i run script from public server, i get content of the file
- if i run script from local server, i dodn't get content
- if i just type public address to url (www.xx.com/foo.txt) it's shown ok
- more strange things .. i can read (from public) and write content of image ex. blaah.gif and write it to local sever. But i can't do same thing with that text-file
// IMAGE READ&WRITE
$handle = fopen ('http://www.somedomain.com/site/content_images/0.gif', "rb");
$contents = "";
do {
$data = fread($handle, 8192);
if (strlen($data) == 0) {
break;
}
$contents .= $data;
} while(true);
fclose ($handle);
$out = fopen("tempp/0.gif", "w");
fwrite($out, $contents);
fclose($out);
// textfile read from public
// THIS WORKS
$fcontents = file ('http://82.181.xx.xxx/content.txt');
while (list ($line_num, $line) = each ($fcontents)) {
echo $line;
}
// THIS DOESN'T WORK
$fcontents = file ('http://www.somedomain.com/content.txt');
while (list ($line_num, $line) = each ($fcontents)) {
echo $line;
}
-> dkruythoff, sorry about that, sometimes it's just frustrating when you have red whole day manual and books and then you got tip: read manual :rolleyes: :queasy:
and yes it goes just like you said, can't read, but can see in browser