I'm trying to upload files into separate folders based on the variable in the URI:
i.e.:
http://example.com/upload.php?name=john
// set specific folder uploads
$destFolder = $_GET['name'];
// success
if(move_uploaded_file($_FILES['upl']['tmp_name'], 'uploads/'.$destFolder.'/'.$timestamp.'-'.$_FILES['upl']['name'])){
echo '{"status":"success"}';
exit;
}
It uploads the file fine, but into "/uploads", not into "/uploads/john".
What am I overlooking? Thanks for looking.