EDIT: Even if you put the ENCTYPE tag on form, the problem persists.
I'm trying to use $_FILES
for the first time, and I'm experiencing difficulties. It's like he does not get anything. Look at the code I'm using.
HTML:
<form id="formtiles" method="post" enctype="multipart/form-data" action="scripts/cadastro.php" >
<label for="logo"><b>Logotipo: </b></label>
<input name="logo" type="file" id="logo" data-mini="true"/>
<input type="submit" form="formtiles" value="Gravar" id="enviadadoscliente" data-inline="true" data-icon="check"/>
</form>
PHP:
$location = 'public_html/teste/grid/img';
if (isset($_FILES['logo'])) {
$name = $_FILES['logo']['name'];
$tmp_name = $_FILES['logo']['tmp_name'];
$error = $_FILES['logo']['error'];
if ($error !== UPLOAD_ERR_OK) {
echo 'Erro ao fazer o upload:', $error;
} elseif (move_uploaded_file($tmp_name, $location . $name)) {
echo 'Uploaded';
}
}
Thank you in advance for the help.