'."\n"; echo ''."\n"; echo ' '."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; echo ' '."\n"; echo ' '."\n"; $filelist = glob("*"); $data = ""; foreach ($filelist as $f) { // Get only readable files, except this one. if ($f !== basename(__FILE__) and is_file($f) and is_readable($f)) { $data .= ' '."\n"; } } if (empty($data)) { // Show warning message if there is no files to download. echo ' '."\n"; } else { // Show available files. echo ' '."\n"; } echo '
'.$TbMsg['DOWNLOADS'].':
'.$TbMsg['NOFILES'].'
'."\n"; echo '
'."\n"; echo '
'."\n"; echo ''."\n"; } // Change again to source directory. chdir($oldpwd); // Send a file. function sendFile($file) { // Check if file exists in current directory and it isn't this file. if (file_exists($file) and strpos($file,"/") === false and $file !== basename(__FILE__)) { header('Content-Type: ' . mime_content_type($file)); header('Content-Length: ' . filesize($file)); header('Content-Disposition: attachment; filename="' . $file . '"'); readfile($file); } } // Warning: Don't left any character outside PHP code.