if($_FILES['myfile']['size'] > 1048576) {
die('ERROR: 1 MB file limit');
}
?>
$allowed_ext = array('doc','txt','rtf'); //add file extensions here...
$ext = end(explode('.',$_FILES['myfile']['name']);
if(!in_array($ext,$allowed_ext)){
die('File extension not allowed');
}
?>
into this:
function display_upload_form()
{
echo <<