hallo hab  nen Script zum Dateiupload leider kommt es zu einer Fehlermeldung : 
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/benutzer/public_html/www_test_php/datei_upload/solution_uploadclass.php on line 5
Parse error ist doch wenn Klammern oder ; fehlen bzw. falsch gesetzt sind, kann aber so einen Fehler nicht finden. kann es daran liegen, das meine PHP-Version 4.3.10 zu alt oder zu neu ist ???
	
							
						
					Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/benutzer/public_html/www_test_php/datei_upload/solution_uploadclass.php on line 5
Parse error ist doch wenn Klammern oder ; fehlen bzw. falsch gesetzt sind, kann aber so einen Fehler nicht finden. kann es daran liegen, das meine PHP-Version 4.3.10 zu alt oder zu neu ist ???
PHP Code:
	
	
<?php 
class upload
{
    private $arrResults;
    const ERRSIZE = "Upload fehlgeschlagen: Die hochgeladene Datei war zu gro�(<u>%1</u> Byte erlaubt, <u>%2</u> Byte geladen).";
        const ERRMIME = "Upload fehlgeschlagen: Dateityp nicht akzeptiert (<u>%1</u> erwartet, <u>%2</u> gesendet)";
       const ERRFAIL = "Upload fehlgeschlagen: Es wurden keine Daten bertragen.";
    function __construct()
    {
        $this->arrResults = array();
    }
    private function GetMsg($msg)
    {
        $return = $msg;
        if (func_num_args() > 1)
        {
            for ($i = 1; $i < func_num_args(); $i++)
            {
                $arg = func_get_arg($i);
                $return = str_replace("%$i", $arg, $return);
            }
        }        
        return $return;
    }
    public function GetResult($prop)
    {
        if (isset($this->arrResults[$prop]))
        {
            return $this->arrResults[$prop];
        } 
        else 
        {
            return '';
        }
    }
    public function copy()
    {
        foreach($_FILES as $fName => $aInfo)
        {
            if ($aInfo['size'] > 0) // if upload was successfully
            {
                $strFileName      = $aInfo['name'];
                $intFileSize      = (int) $aInfo['size'];
                $strFileMIME      = $aInfo['type'];
                $strFileTemp      = $aInfo['tmp_name'];
                $strFileTargetDir = $_POST['UPLOADDIR_'.$fName];
                $strFileTargetMIME= $_POST['UPLOADMIME_'.$fName];
                $intFileTargetSize= (int) $_POST['UPLOADSIZE_'.$fName];
                $blnSuccess = TRUE;
                if ($intFileSize > $intFileTargetSize)
                {
                    $this->arrResults['UPLOADSIZEERROR_' . $fName] = $this->GetMsg(self::ERRSIZE, $intFileTargetSize,  $intFileSize);
                    $blnSuccess = FALSE;
                }
                if (strstr($strFileTargetMIME, $strFileMIME) === FALSE)
                {
                    $this->arrResults['UPLOADMIMEERROR_' . $fName] = $this->GetMsg(self::ERRMIME, $strFileTargetMIME, $strFileMIME);
                    $blnSuccess = FALSE;
                }
                if ($blnSuccess)
                {
                    $dir = dirname($_SERVER['SCRIPT_FILENAME']) . "/{$strFileTargetDir}/{$strFileName}";
                    $this->arrResults['UPLOADFULL_' . $fName] = $dir;
                    $this->arrResults['UPLOADNAME_' . $fName] = $strFileName;
                    $this->arrResults['UPLOADSIZE_' . $fName] = $intFileSize;
                    $this->arrResults['UPLOADMIME_' . $fName] = $strFileMIME;
                    move_uploaded_file ($strFileTemp, $dir);
                }  
            } 
            else 
            {
                $this->arrResults['UPLOADERROR_' . $fName] = $this->GetMsg(self::ERRFAIL);
            }
        }  
    } 
}
?>
          
Comment