php javascript delete after alert
Step #1
put in head section
------------
<script language="javascript">
function del()
{
var cd=confirm('Are You Sure want to this this member!');
if(cd==true)
{
return true;
}
else
{
return false;
}
}
</script>-
Step # 2
-----------
ex:
<a href="edit.php?del=d&mid=<?php echo $row['mid']; ?>" onclick="return del();" ><img border="0" src="images/icon_delete.png" /></a>
Step # 3
-------------
//to delete request
if($_GET['del']=='d')
{
$query_del="DELETE FROM mem WHERE mid='$mid'";
mysql_query($query_del) or die(mysql_error());
header("Location:home.php");
}