Darkwoods Posted October 23, 2008 Share Posted October 23, 2008 im trying to make a delete page but i want a code that ask the user if he/she are sure about deleting it.. if yes it will delete if no it wont! can anybody give any hint on where to start or help me doing it? here is the code i got a very simple and basic one... <?php include "inc/header.php"; $id = $_GET['id']; $result = mysql_query("DELETE FROM news WHERE id='$id' ",$connect); echo "<b>Deleted!"; //header("location: index.php"); // echo "<meta http-equiv=Refresh content=1;url=index.php>"; include "inc/footer.php"; ?> Link to comment https://forums.phpfreaks.com/topic/129843-solved-ask-before-deleting-post-from-database/ Share on other sites More sharing options...
discomatt Posted October 23, 2008 Share Posted October 23, 2008 I'd throw some javascript in to the 'Delete' link: <a href="delete.php" onclick="return confirm('Are you sure you want to delete this entry? It can\'t be undone')")>Delete</a> Link to comment https://forums.phpfreaks.com/topic/129843-solved-ask-before-deleting-post-from-database/#findComment-673152 Share on other sites More sharing options...
Darkwoods Posted October 23, 2008 Author Share Posted October 23, 2008 thank you =) Link to comment https://forums.phpfreaks.com/topic/129843-solved-ask-before-deleting-post-from-database/#findComment-673168 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.