currently i am saving user uploaded image files as follows:
public_html/img/user/$category/$username/$imagename
however, is this bad practice? Why is it bad to store in document root and where would a better place to store the files be?
i filter extensions as follows:
// Check to see if the type of file uploaded is a valid image type
function is_valid_type($file)
{
// This is an array that holds all the valid image MIME types
$valid_types = array("image/jpg", "image/JPG", "image/jpeg", "image/bmp", "image/gif", "image/png");
if (in_array($file['type'], $valid_types))
return 1;
return 0;
}