I figured out that you can set php highliting for the code block like so: [code=php]<?</span>php
if (!empty($_FILES)){ $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT']. $_GET['folder'].'/'; $ext = pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION);//figures out the extension $newFileName = md5($tempFile).'.'.$ext;//generates random filename, then adds the file extension $targetFile = str_replace('//','/',$targetPath). $newFileName;
if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/'; $ext = pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION); //figures out the extension
$newFileName = md5($tempFile).'.'.$ext; //generates random filename, then adds the file extension $targetFile = str_replace('//','/',$targetPath) . $newFileName;
// Uncomment the following line if you want to make the directory if it doesn't exist // mkdir(str_replace('//','/',$targetPath), 0755, true); //echo "$tempFile => $targetFile"; move_uploaded_file($tempFile,$targetFile);
hey it did not work for me until i took out the } at the end
Just a little tip for people who may have used it and it has not worked.