no mám taký upload script a chcem aby v tom hrubom sa nepísalo s diakritikou ale aby sa to transformovalo do stavu bez diakritiky
<?php
/*
*
* Mihalism multi host v3.1.x
* Copyright (c) 2005 - 2007 Mihalism Inc (
www.mihalism.com)
*
*/
require_once('./page_header.php');
$file_count = 0;
$path = $CONFIG['file_path'];
switch($_POST['type']){
case 'url_upload':
url_upload();
break;
default:
direct_upload();
}
function direct_upload(){
global $CONFIG, $DB, $UDATA, $file_count, $path, $filename;
for($i = 0; $i <= 15; $i++){
$file = array(
'name' => $_FILES['userfile']['name'][$i],
'size' => $_FILES['userfile']['size'][$i],
'tmp' => $_FILES['userfile']['tmp_name'][$i],
'error' => $_FILES['userfile']['error'][$i],
'rand' => random_string(2)
);
if($file['error'] != 4 && $file['name'] != ''){
$file_count++;
if($file_count <= 15){
if($i >= 1){
echo "<div class='cell_divider'></div><br>\n";
}
$extension = file_type($file['name']);
$filename = $file['rand']."-".
$file['name'];
$thumbnail = thumbnail_name($filename);
if(!in_array($extension, $CONFIG['file_types'])){
message("Veľkosť súboru <b>{$file['name']}</b> nie je povolená.");
}elseif($file['size'] > $CONFIG['max_file_size']){
message("Súbor <b>{$file['name']}</b> prekračuje maximálnu povolenú veľkosť.");
}elseif($file['error'] != 0){
$filerror = array(
1 => "Súbor <b>{$file['name']}</b> prekračuje <a href=\"http://us2.php.net/manual/en/ini.core.php#ini.upload-max-filesize\">upload_max_filesize</a> directive in php.ini.",
2 => "The file <b>{$file['name']}</b> exceeds the <b><i>MAX_FILE_SIZE</i></b> directive that was specified in the HTML form.",
3 => "Súbor <b>{$file['name']}</b> bol nahratý iba z časti.",
6 => "Chýba dočasný súbor.",
7 => "Chyba pri zapisovaní súboru <b>{$file['name']}</b> na disk.",
8 => "Nahrávanie súboru <b>{$file['name']}</b> bolo pre ťažkosti zastavené."
);
message($filerror[$file['error']]);
}elseif(file_exists(ROOT_PATH.$path.$filename)){
message("Vyzerá, že súbor <b>{$file['name']}</b> už a tomto servery existuje.");
}elseif(!move_uploaded_file($file['tmp'], ROOT_PATH.$path.$filename)){
message("File upload failed for file <b>{$file['name']}</b>.");
}else{
if($CONFIG['is_user'] == true){
$DB->query("INSERT INTO `".SQL_FILE_STORAGE_TABLE."` VALUES('', '{$filename}', '0', '{$UDATA['user_id']}');");
}else{
$DB->query("INSERT INTO `".SQL_FILE_STORAGE_TABLE."` VALUES('', '{$filename}', '{$_POST['private']}', '0');");
}
$DB->query("INSERT INTO `".SQL_FILE_LOGS_TABLE."` VALUES ('', '{$filename}', '".time()."', '{$_SERVER['REMOTE_ADDR']}');");
create_thumbnail($filename);
results_table();
}
}
}
}
}
if($file_count == 0){
message("Vráťte sa späť a ".(($_POST['type'] != 'url_upload') ? 'vyberte' : 'zadajte')." aspoň jeden súbor pre nahratie.");
}
require_once('./page_footer.php');
?>