ニュースを更新するページがありますが、機能しません。このコードはありますが、変数 $imagem にエラーがあります。
<?php
session_start();
require_once '../config.php';
$id_nt = $_GET["id_nt_up"];
$titulo = $_POST["noticia_titulo"];
$conteudo = $_POST["noticia_conteudo"];
$descricao = $_POST["noticia_descricao"];
$autorPub = $_SESSION["Usuario"];
$autorSen = $_SESSION["Senha"];
$SQL_AU = mysql_query("SELECT id, Nome FROM utilizadores WHERE Usuario='$autorPub' and Senha='$autorSen' ");
while($ath = mysql_fetch_assoc($SQL_AU)){
$autorN = $ath["Nome"];
$idAutor = $ath['id'];
}
// Configuração da Imagem
$imagem = $_FILES["imagem-noticia"];
$destino = "../img/noticias/".$imagem['name'];
if(isset($_POST["submit"])){
mysql_query("UPDATE noticias SET Titulo='$titulo', Conteudo='$conteudo', Descricao='$descricao', Username=$autorN, Imagem='".$imagem['name']."' WHERE id_noticia=$id_nt");
if($imagem['type'] == "image/jpeg"){
if($imagem['type'] == "image/jpeg"){
move_uploaded_file($imagem['tmp_name'] , $destino);
}else if($imagem['type'] == "image/png"){
move_uploaded_file($imagem['tmp_name'] , $destino);
}else if($imagem['type'] == "image/gif"){
move_uploaded_file($imagem['tmp_name'] , $destino);
}
}
}
?>
ニュースを更新しようとすると、このエラーが発生します。
注意: 未定義のインデックス: C:\wamp\www\bootstrap-3.1.1-dist\admin\editar_noticia_sucess.php の 35 行目の imagem-noticia
editor_noticia_sucess.php は上記のファイルです。
よろしく、 ルイス・カンデイアス