Open file under IIS Web Server
Posted: Fri Oct 06, 2006 6:46 am
Our computer using IIS Web Server.
I have strange problem to open a XML file that placed in another computer. My script just open XML file in local (my own PC), this is the script:
<?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("[Path of file in my own PC]");
echo $temp;
?>
It works.
But, when I replace the path with http:\\[IP number (target)]\[location of file]\[filename][extension],
Message "File: ".$filename." isn't found." appeared.
When I use my browser (IE) the file is showed, but when I use the script, it isn't work.
Thanks for your help !
I have strange problem to open a XML file that placed in another computer. My script just open XML file in local (my own PC), this is the script:
<?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("[Path of file in my own PC]");
echo $temp;
?>
It works.
But, when I replace the path with http:\\[IP number (target)]\[location of file]\[filename][extension],
Message "File: ".$filename." isn't found." appeared.
When I use my browser (IE) the file is showed, but when I use the script, it isn't work.
Thanks for your help !