In my PHP web page I have a file type input in a form and when I submit it I can get the file name which was uploaded with $_POST['upload'] but if I use $_FILES['upload']['tmp_name'] it gives nothing — why? How can I use $_FILES to get the file to attach it to my email?
In my PHP web page I have a file type input in a form
Share
You got nothing when you use
$_FILEbecause you didn’t use theenctypeattribute on your form. Check how to use it here.