1

I have this script which takes the Fname from a HTML form. When I insert Greek characters, the name of the folder is displayed with symbols in Windows Explorer. Why is this happening and what can I do to fix this?

$folderStr = $_REQUEST['FName'];

//create SEO firndly directory name
$upload_folder =    preg_replace ("'\s+'", '-', $folderStr);

// The place the files will be uploaded to (currently a 'files' directory).
 $upload_path = './uploads/'.$upload_folder.'/';

//Check whether folder exists or create with the name supplied

if(is_dir($upload_path))
echo 'directory exists';
else
mkdir ('./uploads/'.$upload_folder.'/', 777);
4

1 回答 1

1

确保您提交的表单是 utf-8 编码的。

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
于 2012-06-30T23:01:04.130 回答