Heres my code, its supposed to filter out disallowed file extensions:
but I tested it and it dosnt stop any extensions at all, could someone fix it please?
PHP:
<?php
$ext = strrchr($_FILES['uploadedfile']['name'], '.');
if($ext == ".gz"){
$ext = ".tar.gz";
}
if((!$ext==".gif")&&(!$ext==".zip")&&(!$ext==".jpg")&&(!$ext==".jpx")&&(!$ext==".jpe")&&(!$ext==".jpeg")&&(!$ext==".png")&&(!$ext==".bmp")&&(!$ext==".wmv")&&(!$ext==".avi")&&(!$ext==".mpg")&&(!$ext==".mov")&&(!$ext==".asf")&&(!$ext==".asx")&&(!$ext==".swf")&&(!$ext==".3g2")&&(!$ext==".mp4")&&(!$ext==".mp3")&&(!$ext==".wav")&&(!$ext==".mid")&&(!$ext==".tar.gz")&&(!$ext==".arc")&&(!$ext==".arg")&&(!$ext==".czip")&&($ext==".doc")&&(!$ext==".xls")&&(!$ext==".mdb")&&(!$ext==".ppt")&&(!$ext==".txt")&&(!$ext==".rtf")) {
//ive taken out this code because its not causing the problem
//this is the disallowed extension code
}else{
//ive taken out this code because its not causing the problem
//this is the allowed extension code
}
?>
but I tested it and it dosnt stop any extensions at all, could someone fix it please?






