hello, i have a small problem with my file upload script, for some reason the file size or and the file extensions conditions wont work, and i don`t know why,
everything else works fine, if i wanna upload a file that has the right size it will upload, or if i upload a php file this one will upload too, i dont know why the condition wont kick in
[php]if (isset($_FILES[‘file’])){
$target = "../../uploads/";
$rand = rand(1, 9999);
$target = $target . $rand . basename( $_FILES['file']['name']) ;
$file_size = $_FILES['file']['size'];
$file_ext = strtolower(end(explode('.', $_FILES['file']['name'])));
if ($file_size >= 12000000) {
header("Location: ../files/post?error=2&cid=".$cid);
}
if ($file_ext == 'php') {
header("Location: ../files/post?error=3&cid=".$cid);
}
move_uploaded_file($_FILES['file']['tmp_name'], $target);
}[/php]