1
I have the following php file called remove.php, with it I am removing a record from a table, after removed I display a dialog box returning whether it can be removed or not, I would like that by clicking on OK in this dialog box I could direct myself to another php file.
I was afraid to use the header("Location: lista.php")
, but when I use the dialogue box on the screen and I’m already redirected to the other file, I also tried to use the header("refresh: 5; url=lista.php")
, but I was also unsuccessful.
Someone more experienced could help me?
<?php
include("cabecalho.php");
include("conecta.php");
function removeProduto($conexao, $id){
$query = "delete from colaboradores where cpf = '{$id}'";
return mysqli_query($conexao, $query);
}
$id = $_POST['id'];
removeProduto($conexao, $id);
$ret = mysqli_affected_rows($conexao);
if($ret == 1){
?>
<script>
confirm('colaborador excluído com sucesso!');
</script>
<?php
}else if($ret == -1){
?>
<script>
confirm('colaborador não pode ser excluído!');
</script>
<?php
}
?>
thanks for the help William. ;)
– user134096