I'm a noob in php and I need some help please. I have a uploading script that uploads something to my server. So after I upload the file i get a message your file was upload and I want this message to be posted in my html upload page(main page) and the code is like this:
if(empty($errors)===true){ move_uploaded_file($file_tmp,"upload/".$file_name); echo "Your file was upload!"; <- I want this line to be printed in other page // }else{ print_r($errors); } } Edit : And I found an error to my script if you could help me with this two please:
$file_name=$_FILES['file']['name']; $file_tmp =$_FILES['file']['tmp_name']; $file_type=$_FILES['file']['type']; $file_ext=strtolower(end(explode('.',$_FILES['file']['name']))); $extensions = array("rar","zip","jpeg","jpg","png","gif"); if(in_array($file_ext,$extensions)=== false){ $error[]= "Extension not allowed, please choose a RAR or ZIP file or if you upload an image use JPEG, JPG, PNG or GIF format.</br> Thank you!"; } This is my code to restrict file upload,but it won't take the restrictions,can any1 tell me why please?
Hope I'm explicit enough. Thank you !