Me pueden ayudar y decirme que parte esta mal
gracias
Código PHP:
$idM= filter_input(INPUT_POST, 'idM');
$objdb = new database();
$nombre_carpeta = "cabecera"
if (!is_dir($nombre_carpeta)) {
@mkdir($nombre_carpeta, 0700);
}
// A list of permitted file extensions
$allowed = array('png', 'jpg', 'gif', 'zip');
if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
$extension = pathinfo($_FILES['upl']['name'], PATHINFO_EXTENSION);
if (!in_array(strtolower($extension), $allowed)) {
echo '{"status":"error"}';
exit;
}
$nombreImagen = md5(uniqid(rand() . time())) . "_" . $_FILES['upl']['name'];
$objdb->abrir();
$objdb->sql("CALL sp_ingresarImagenes('$nombreImagen','$idM')");
$objdb->cerrar();
if (move_uploaded_file($_FILES['upl']['tmp_name'], $nombre_carpeta . '/'
. $nombreImagen))
{
echo '{"status":"success"}';
exit;
}
}
echo '{"status":"error"}';
exit;