Hi,
i'm using a javascript so i can do a messagebox confirmation, and then it goes to a .php where is the delete sql. But is not working:
<!---------------------------------------------->
<script language="JavaScript">
function confirmBox(id)
{
if (confirm("Tem a certeza que pretende eliminar este utilizador? "))
{
location.href="remover_user.php";
}
else
{
return false;
}
}
</script>
<!---------------------------------------------->
(.............)
<td width="5%">
<a href="#" onclick="confirmBox('<?php echo $row_users['id_utilizador']; ?>')">Remover</a>
</td>
remover_user.php:
<?php
include 'db_connect.php';
session_start();
if (isset($_GET['id_utilizador']))
{
$delete = "DELETE FROM utilizadores WHERE id_utilizador='".$_GET['id_utilizador']."'";
$resultado = mysql_query($delete, $connect);
header ('Location: users.php');
}
?>