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"; ?> Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
Darkwoods Posted October 23, 2008 Author Share Posted October 23, 2008 thank you =) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.