Parse error: syntax error, unexpected T_STRING in /home/schelp01/public_html/home/lib/cache/cachelib.php on line 34

that is the error

function cacheItem($key,$data) {
		$key = md5($key);
		00033 $fw = fopen($this->folder."/$key","w");
		00034 fwrite($fw,$data);
		00035 fclose($fw);
		return true;

It started saying that lines 33 34 and 35 were messed up then i got it to only say 33 was messed up now it only says that line 34 is messed up >.<

Can anyone assist me!?!?!

    Can you please paste a larger block of your code? Syntax errors can often "cascade" and therefore not necessarily indicate the actual problem. Syntactically, that code looks fine.

    Also, have you tried reformatting the code (specifically, the line-breaks) manually?

    Lastly, please wrap your code in PHP tags (as opposed to "code" tags), so it's easier for us to read.

    Thanks!

      TikiWiki is the program the website is my tikiwiki

      <?php
      // $Header$
      
      //this script may only be included - so its better to die if called directly.
      if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
        header("location: index.php");
        exit;
      }
      
      /*
      A basic library to handle a cache of some Tiki Objects,
      usage is simple and feel free to improve it
      */
      
      class Cachelib {
      
        var $folder;
      
        function Cachelib() {
      		global $tikidomain;
      		$this->folder = "temp/cache";
      		if ($tikidomain) { 
      			$this->folder.= "/$tikidomain"; 
      		}
          if(!is_dir($this->folder)) {
        		mkdir($this->folder);
      			@chmod($this->folder,"0777");
          }
        }
      
        function cacheItem($key,$data) {
      		$key = md5($key);
      	                $fw = fopen(($this->folder)."/".$key,"w"); 
      		00034 fwrite($fw,$data);
      		00035 fclose($fw);
      		return true;
        }
      
        function isCached($key) {
      		$key = md5($key);
      		return is_file($this->folder."/$key");
        }
      
        function getCached($key) {
      		$key = md5($key);
      	if ( filesize($this->folder."/$key") == 0 ) { 	
      			return serialize(false);
      		} 
      		$fw = fopen($this->folder."/$key","r");
      		$data = fread($fw,filesize($this->folder."/$key"));
      		fclose($fw);
      		return $data;
      }
      
        /** gets the timestamp of item insertion in cache,
         *  returns false if key doesn't exist
         */
        function getCachedDate($key) {
            $key = md5($key);
            if( is_file($this->folder."/$key") ) {
                return filemtime($this->folder."/$key");
            } else return false;
        }
      
        function invalidate($key) {
      		$key = md5($key);
      		@unlink($this->folder."/$key");
        }
      }
      
      $cachelib = new Cachelib();
      ?>
      

      This is the entire thing and I am a complete newb to this stuff, first time ever in cpanel so yeah -.-

      Gonna need a copy paste type situation here

        Write a Reply...