initial commit
This commit is contained in:
20
categoria/proc_edit_cat.php
Normal file
20
categoria/proc_edit_cat.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
session_start();
|
||||
include_once("..\conexao.php");
|
||||
|
||||
$id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);
|
||||
$nome = filter_input(INPUT_POST, 'nome', FILTER_SANITIZE_STRING);
|
||||
|
||||
$result= "UPDATE categoria SET categoria='$nome' WHERE id='$id'";
|
||||
$resultado= mysqli_query($con, $result);
|
||||
|
||||
|
||||
if(mysqli_affected_rows($con)){
|
||||
$_SESSION['msg'] = "<p style='color:green;'>Categoria alterada com sucesso</p>";
|
||||
header("Location: index.php");
|
||||
}else{
|
||||
$_SESSION['msg'] = "<p style='color:red;'>Categoria não foi alterada</p>";
|
||||
header("Location: edit_cat.php?id=$id");
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user