Will this only allow certain extensions?
- by Dr Hydralisk
I found this snippet that says will only allow certain file types. Will it work and could someone bypass it to upload what ever file type they want? And could someone explain the substr part, i don't get how it works..
<?php
function CheckExt($filename, $ext) {
$name = strtolower($filename);
if(substr($name, strlen($name) -3, 3) == $ext)
return true;
else
return false;
}
?>