index.php
Código PHP:
<?php
// includes, conexiones base de datos etc...
$select="select id,nombre from tabla";
$select=mysql_query($select);
?>
<html>
<head>
<script type="text/javascript">
function go(msg,url)
{
if(msg=="")
{
location.href=url;
}
else
{
if(confirm(msg))
{
location.href=url;
}
}
}
</script>
</head>
<body>
<?php
while($row = mysql_fetch_array($select))
{
?>Nombre: <?php echo $row["nombre"]; ?> <img src="borrar.png" alt="Borrar" onclick="go('¿Estas seguro de que desea borrar: <?php echo $row["nombre"]; ?> ?','borrar.php?id=<?php echo $row["id"]; ?>')" /><br /> <?php
}
?>
</body>
</html>
borrar.php
Código PHP:
<?php
// includes, conexiones base de datos etc...
$id=$_GET["id"];
$delete="delete from tabla where id=".$id." limit 1";
$delete=mysql_query($delete);
header("Location: index.php");
exit();
?>
es un ejemplo donde esta bastante claro, suerte!!!!