0
The error that is generated me is the following:
Notice: Only variables should be passed by Ference in
Can anyone tell me how to fix it? According to the error, it’s in this part:
$extensoes_aceitas = array('bmp' ,'png', 'svg', 'jpeg', 'jpg');
$extensao = end(explode('.', $_FILES['foto']['name']));
Follows the code...
if ($acao == 'incluir'):
$nome_foto = 'padrao.jpg';
if(isset($_FILES['foto']) && $_FILES['foto']['size'] > 0):
$extensoes_aceitas = array('bmp' ,'png', 'svg', 'jpeg', 'jpg');
$extensao = end(explode('.', $_FILES['foto']['name']));
// Validamos se a extensão do arquivo é aceita
if (array_search($extensao, $extensoes_aceitas) === false):
echo "<h1>Extensão Inválida!</h1>";
exit;
endif;
Tell me something, this way I can upload other files like pdf for example?
– Lucas Fiiguer
Upload you get from qq thing, this your code only runs after the upload done. The most that it serves is for you to discard something that you do not want after upado.
– Bacco