[TYPO3-german] php mit lumophpinclude
a owen
aowen at swissonline.ch
Sat Feb 10 12:02:33 CET 2007
Hallo,
Ich kann in meinem PHP-Script in einer Funktion keine Variablen
ausserhalb der Funktion mit global oder $GLOBALS sehen. Kann das sein,
dass typo3 etwas macht. Bisher konnte ich dies immer in PHP. Das Echo
auf der 3. Linie gibt nur "mmmmmmm" aus.
Gruss
Script:
<?
$a = 45768;
function uploadFile($tmpFile, $id) {
global $fault, $pathOrg, $a;
echo $GLOBALS['a'].' mmmmmmm';
$file['date'] = date('YmdHis');
$file['type'] = substr($tmpFile['name'], strrpos($tmpFile['name'],
'.'));
$file['name'] = $tmpFile['name'];
$name = $file['date'].$id;
if(is_uploaded_file($tmpFile['tmp_name'])) {
if(eregi('image', $tmpFile['type'])) {
$destination = $GLOBALS['pathOrg']['img'].$tmpFile['name'];
//exec('imagemagick '.$file['tmp_name'].' '.$destination);
} elseif(eregi('audio', $tmpFile['type'])) {
$destination = $pathOrg['audio'].$tmpFile['name'];
//exec('swftool '.$file['tmp_name'].' '.$destination);
} elseif(eregi('video', $tmpFile['type'])) {
$destination = $pathOrg['video'].$tmpFile['name'];
//exec('swftool '.$file['tmp_name'].' '.$destination);
}
echo $destination;
if(move_uploaded_file($tmpFile['tmp_name'], $destination))
return $file;
else
$fault .= 'errorProcessFile';
} else
$fault .= 'errorUpload';
return false;
}
More information about the TYPO3-german
mailing list