I have got this:
<input type="file" name="image">
if(isset($_POST['submit']))
{
if(isset($_FILES['image']['name']))
{
$image=$_FILES['image']['name'];
}
else
{
$error= 'Error: no image was set ';
}
basically, it tells me that the image, name doesnt exist doesnt exist..why is that?
{
$error= 'Error: no image was set ';
}
Does your FORM have an enctype=”multipart/form-data” attribute?
EncType attribute is used to tell the browser how to post the data to the server. If you don’t use a multipart mime type, the data can’t be sent to the server correctly.
Multipart looks like this:
You don’t have to send it yourself, just set the enctype, and all that magic is done for you.