Update core.php

This commit is contained in:
Eric Johansson (neku) 2015-02-11 03:43:43 +01:00
parent 6e46f9b0a2
commit d2ef06f2dc
1 changed files with 3 additions and 0 deletions

View File

@ -10,10 +10,13 @@ function save_file ($file, $name){
echo 'http://a.uguu.se/'.$file_name;
}
Function gen_name ($in){
//Check so the file doesn't exist, and generate random prefix
while(file_exists('/home/neku/www/files'.$name.'_'.$in)){
$chars = 'abcdefghijklmnopqrstuvwxyz';
$name = '';
for ($i = 0; $i < 6; $i++) {
$name .= $chars[mt_rand(0, 25)];
}
}
return $name.'_'.$in;
}