<?php $error=""; if (isset($_POST['btn_submit'])){ $file_name=$_FILES['upload']['name']; $file_size=$_FILES['upload']['size']; echo $extension=substr($file_name,strpos($file_name,".")); $allowed=array(.jpg,.jpeg,.gif,.tiff,.png); if (!in_array($extension,$allowed)){ $error="File type is not Allowed"; } } ?> <html> <form action="" method="POST" enctype="multipart/form-data"> Upload File :<input type="file" name="upload"/><br/> <input type="submit" name="btn_submit" value="Submit"/><br/> </form> </html> Code (markup): Displaying this error Parse error: syntax error, unexpected '.', expecting ')' in C:\xampp\htdocs\upload.php on line 9 Code (markup): Plz help me. How resolve this ..
I Change this part <html> <form action="" method="POST" enctype="multipart/form-data"> Upload File :<input type="file" name="upload"/><br/> <input type="submit" name="btn_submit" value="Submit"/><br/> <php echo $msg; ?> </form> </html>