I have some code that needs to see if a file has been selected before it runs the code .... its pretty simple code, its just not working for some reason and i cant see why. my code is as follows
if(isset($_FILES['filename'])){
$directory = 'uploads/'.substr(md5(microtime() * mktime()),0,15);
if(!is_dir($directory)){
mkdir($directory, 0777, TRUE);
chmod($directory, 0777);
}
}
I have multiple file fields which are coded like so:
<input class="file-input" name="filename[]" type="file" size="32" />
When i move the code OUTSIDE the 'if(isset......' block, it works perfect .... just not inside it, and thats where i need it.
Can anyone see where im going wrong?