Jump to content

Please can someone help!


robbaust

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.