if(isset($_FILES['fileupload'])){ $errors= array(); $file_name = $_FILES['fileupload']['name']; $file_size =$_FILES['fileupload']['size']; $file_tmp = $_FILES['fileupload']['tmp_name']; $file_type = $_FILES['fileupload']['type']; $file_parts = explode('.',$_FILES['fileupload'][$file_name]); $file_ext = strtolower(end($file_parts)); $expensions= array("pdf","doc","docx");// Define with files are accepted $OriginalFilename = $FinalFilename = preg_replace('`[^a-z0-9 _.]`i','',$_FILES['fileupload']['name']); $FileCounter = 1; ..............}
Quote:While working in PHP, you will come across two methods called $_POST and $_GET. These methods are used for obtaining values from the user through a form. When using them, you might encounter an error called “Notice: Undefined Index”. This error means that within your code, there is a variable or constant that has no value assigned to it. But you may be trying to use the values obtained through the user form in your PHP code. The error can be avoided by using the isset() function. This function will check whether the index variables are assigned a value or not, before using them.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)