Hello,
When I run the following script, it returns the else conditional. However, the extension displayed "Extension: $ext" is accurate, and should return the if. There is obviously something in this script that I am overlooking.
revez2002
// Define the extensions that will be permitted for upload
$allowed_ext = "txt, doc, pdf, xls";
// Validate the type of file based on its extension
$extension = pathinfo($_FILES['userfile']['name']);
$extension = $extension[extension];
$allowed_files = explode(", ", $allowed_ext);
for($i = 0; $i < count($allowed_files); $i++) {
if ($allowed_files[$i] == "$extension") {
$continue_upload_status = "yes";
} else {
echo "Problem: This file type cannot be uploaded<br>";
echo "Extension: $extension<br>";
exit;
}
}