does this code look like it would check a file extensions, and disallow php files or exe files to be attached

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?php


$filelinks=t3lib_div::_POST('file_name'); // the posting of the file name

$exttypes = "php3,php,exe";                                     // list of
extensions that shouldnt be used
$fileextension = substr($filelinks,0,strpos($filelinks,"."));     //get the
extension after the .
if ($fileextension == $exttypes['php']['php3']['exe']) {         //if the
file extension equals php, php3, or exe
   echo "mime type doesn't work";                                 //if the
extension is php, php3, exe, than echo doesn't work
   }
   if ($fileextension != $extypes['php']['php3']['exe']) {     //if the
file extension doesn't equal php, php3, or exe than
                                                               // store the
file
       $filelinks = $this->storeFile();
       }

?>


I'm not a programmer, and I'm very new at php so im sure there are errors
and stupid logic in my code.

It would be greatly appreciated if anyone here could critique and rip apart
my code.

thank you,

-dave

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux