<?php
include("qs.php");
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
require( '../data/config.php');
$conn=mysql_connect($db_host,$db_user,$db_pass);
mysql_query("set names 'utf8'");
mysql_select_db($db_name);
if (PHP_VERSION >= '5.1' && !empty($timezone))
{
    date_default_timezone_set($timezone);
}
$filename=_get('filename');
if(mysql_fetch_object(mysql_query("select * from tm_art_class where filename='$filename'")))
{
echo "<font color=red size=2>".$filename."</font><font color=#000000 size=2> 已存在，请用其它目录名称！</font>";
exit();
}
else
{
$dir = "../";
$handle=opendir($dir);
while ($file = readdir($handle)) 
{
if($file<>"." and $file<>".." and is_dir( $dir ."/".$file ))
	   {
	   if($file==$filename)
	      {
	      echo "<font color=red size=2>".$filename."</font><font color=#000000 size=2> 已存在，请用其它目录名称！</font>"; 
	      exit();
		  }
	   }
}
echo "<font color=#339933 size=2>".$filename."</font><font color=#000000 size=2> 恭喜你，目录名称可以使用！</font>";
exit();
}
?>