<?php
 function make_id($length)
 {
 $hash = '';
 $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
 $max = strlen($chars) - 1;
 mt_srand((double)microtime() * 1000000);
 for($i = 0; $i < $length; $i++) {
 $hash .= $chars[mt_rand(0, $max)];}
 return $hash;
 }
 function make_pass($length)
 {
 $hash = '';
 $chars = '1234567890';
 $max = strlen($chars) - 1;
 mt_srand((double)microtime() * 1000000);
 for($i = 0; $i < $length; $i++) {
 $hash .= $chars[mt_rand(0, $max)];}
 return $hash;
 }
 function make_save_path($id,$time)
 {
	 $dp   = date('ym',$time);
	 $path = "./file/$dp/$id.data";
	 $timepath = "./file/$dp/";
	 if(!file_exists($timepath))
	 {mkdir($timepath,0777);}
	 return $path;
 }
function get_ext($name){
    $a= explode('.',$name);  
	$a = array_reverse($a); 
    return $a[0]; 
}
function get_name($name){
	$strlen=strlen(strrchr($name,'.'));
    return substr($name,0,-$strlen);
}
?>