-1
Good evening! I have a page excluirConta.php that is not functional, here is the code:
<?php
session_start();
require_once("../banco/conexao.php");
if (isset($_SESSION['id'])) {
$id = $_SESSION['id'];
$query = "DELETE * FROM usuario WHERE id = " . $_SESSION['id'];
$result = mysqli_query($conexao, $query);
if (!$result) {
die("Falha ao excluir dados.");
} else {
echo "<script type='text/javascript'>window.alert('Usuário Excluído com Sucesso!');</script>";
echo '<meta HTTP-EQUIV="Refresh" CONTENT="1; URL="../index.php">';
exit;
header("Location: ../index.php");
}
}
And here’s the form I’m passing the variable in:
<form action="excluirConta.php?id=<?php echo $_SESSION['id']; ?>" method="POST">
<label class="col-md-3 control-label"></label>
<div class="col-md-8">
<input class="btn btn-danger" type="submit" value="Excluir Conta"name="excluirUsuario" onclick="return confirm('Você está prestes a excluir a sua conta e todos os seus dados serão perdidos. Tem certeza?');" />
</div>
</form>
When I click delete, the only thing that happens is that the page updates and the data appears in the URL, as if I was getting by GET, someone can help?
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero
I was hoping to pop up the option to move to the chat, but she didn’t show up. There is a possibility that I can move the conversation to the chat at any time during the conversation ?
– Gato de Schrödinger