robbaust Posted September 30, 2011 Share Posted September 30, 2011 Hi there I'm playing around with this code www.rob_austin.co.uk/bbc but getting this error MM_XSLTransform error. Error opening I know it's something to do with the fOpen statement but don't know where to go from here, I have tried to use th cUrl statement but nothing seems to work, so just wondering if anyone can help me this is the code // avoid protocol upper case $mySrc = $protocol . substr($src, $pos); $magic_quotes_runtime_orig = get_magic_quotes_runtime(); set_magic_quotes_runtime(0); if ($myFile = @fopen($mySrc, 'rb')) { while ($data = fread($myFile, 2048)) { $fileContent .= $data; } fclose($myFile); } else { $this->setError($this->getErrorFromCode('MM_OPEN_REMOTE_ERROR', array($src))); if ($protocol == 'https') { $this->setError($this->getErrorFromCode('MM_HTTPS_OPEN_ERROR', array($src))); if ( (substr(PHP_VERSION, 0, 1) < 5) && (substr(PHP_VERSION, 2, 1) < 3) ) { $this->setError($this->getErrorFromCode('MM_HTTPS_NOT_SUPPORTED_ERROR', array($src))); } } } set_magic_quotes_runtime($magic_quotes_runtime_orig); return $fileContent; } function getLocalFile(&$src) { $fileContent = ''; $mySrc = realpath($src); if (!file_exists($mySrc)) { $this->setError($this->getErrorFromCode('MM_OPEN_FILE_ERROR', array($src))); return $fileContent; } clearstatcache(); if (!is_readable($mySrc)) { $this->setError($this->getErrorFromCode('MM_FILE_NOT_READABLE_ERROR', array($src))); return $fileContent; } $magic_quotes_runtime_orig = get_magic_quotes_runtime(); set_magic_quotes_runtime(0); if ($myFile = fopen($mySrc, 'rb')) { while ($data = fread($myFile, 4096)) { $fileContent .= $data; } fclose($myFile); } set_magic_quotes_runtime($magic_quotes_runtime_orig); return $fileContent; } Thanks in Advance for any help you guys can offer Regards Rob Link to comment https://forums.phpfreaks.com/topic/248197-please-can-someone-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.