<?phpif (isset($_FILES ['documents'])) { $errors=array () ; $allowed_ext= array ('doc','docx','ppt','pptx','pages','html','els','elsx','numbers'); $file_name= $_FILES ['documents'] ['name']; $file_ext= strtolower(end(explode ('.', $file_name))); $file_size=$_FILES ['documents'] ['size']; $file_tmp= $_FILES ['documents'] ['tmp_name']; if (in_array($file_ext, $allowed_ext) === false) ( $errors[] ='Extension not allowed'; )}?><!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8" /> <title></title> </head> <body> <form action="" method="post" enctype="multipart/form-data"> <p> <input type="file" name="documents"/> <input type="submit" value="Upload"/> </p> </form> </body></html>
I keep on geting error's and I don't know why. I've been starring at this for hours :(
{}
not
()