open from url
Brought to you by:
bs_php,
nigelswinson
From: <php...@li...> - 2001-10-22 00:38:31
|
Hey Nigel, this one is easy to fix. Up to this point you guys were checking whether the local file existed and if it was readable, which would immediately eliminate the possibility of grabbing a web url...check out this change to the import from file function: /* snip beginning of import from file up to the following comment... */ // Check whether the file exists and is readable. if ( preg_match(";^http://;",$fileName) ) { // Read the content of the file. $content = implode("", file($fileName)); if ( empty($content) ) { // Display an error message. $this->_displayError("The url {$fileName} could not be found or read.", __LINE__); return; } } else { if (!file_exists($fileName) || !is_readable($fileName)) { // Display an error message. $this->_displayError("File {$fileName} could not be found or read.", __LINE__); return; } // Read the content of the file. $content = implode("", file($fileName)); } $this->importFromString(&$content); /* end function importfromfile */ Dan On Sunday 21 October 2001 10:01 am, you wrote: > Hello, > > I'm trying to write a little rdf parser (more exactly a file to read > php-nuke backend.php file) and it seems I fail to open a distant file. > > I have no problem with a local one but how can I access via > http://www........ ? > > Thanks in advance > > Luc > > > _______________________________________________ > Phpxpath-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpxpath-users ------------------------------------------------------- __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com |