Page 1 of 1

Open a file in network

Posted: Mon Oct 09, 2006 8:09 pm
by Pancoro
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi, I have problem to open a XML file that stored in other computer. 
We use Microsoft IIS as web server and I create a PHP file to access the file. 
This is the script:

Code: Select all

<?php 
function LoadTpl($template="") { 
$filename = $template; 
if ( file_exists($filename) ) { 
if ( $FH = fopen($filename, "r") ) { 
$template = fread( $FH, filesize($filename) ); 
fclose($FH); 
} else { 
die("The file can't opened."); 
} 
} else { 
die("File ".$filename." isn't found."); 
} 
return $template; 
} 

$temp=LoadTpl("http://[IP target]/[filename][.][extension of file]"); 
echo $temp; 
?>
When I try to open and read a file in my own computer, the script works, but hen I try to open a file in another computer, message "File [filename] isn't found" appeared.
How to open a file in another computer? I use IP address but failed.

I need your guidance.



Thanks for your help !


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Mon Oct 09, 2006 10:28 pm
by ambivalent
What about the response you received here?