How To Make Dynamic Changing Upload Path
<p>Im trying to make a file upload system where whenever a file is upload the file goes into a uploads folder set like this uploads/2012/09/{randomhash}/.</p>

<p>To do this i tried the code below.</p>

<pre><code>$hash   = RandomString(20);
$upload_path = '../../uploads/'.$year.'/'.$month.'/'.$hash.'/';
if (!is_dir($upload_path))
{
    mkdir($upload_path, 0777);
}
</code></pre>

<p>For some reason its not working and i have no idea why.</p>
