saeed_violinist Posted June 3, 2009 Share Posted June 3, 2009 Dear friends, I want to know how to ask user if they really want to do a simple task like deleting a member from database. I made a link like "manage.php?action=delete?id=2", ofcourse by clicking on this link user with id=2 will be deleted from the database. but how to ask from user if they really want to delete or not? I know there is a method to confrim FORM submission, but I dont want to convert every link like that to a form. Thanks. Link to comment https://forums.phpfreaks.com/topic/160762-confitm-befor-submission-of-a-link/ Share on other sites More sharing options...
jxrd Posted June 3, 2009 Share Posted June 3, 2009 You could so something like this: if(!isset($_GET['confirmed'])) { echo 'Do you really want to delete this?<br /><a href="'.$_SERVER['REQUEST_URI'].'&confirmed=true">yes</a>'; } else { //delete.... } This is just an example - it'd be more secure to do with the POST method and a form, but you get the idea... Link to comment https://forums.phpfreaks.com/topic/160762-confitm-befor-submission-of-a-link/#findComment-848450 Share on other sites More sharing options...
Axeia Posted June 3, 2009 Share Posted June 3, 2009 http://www.tizag.com/javascriptT/javascriptconfirm.php Just ommit the else part. Link to comment https://forums.phpfreaks.com/topic/160762-confitm-befor-submission-of-a-link/#findComment-848462 Share on other sites More sharing options...
saeed_violinist Posted June 3, 2009 Author Share Posted June 3, 2009 The problem is I want to use it inside a php for loop, so for every loop it should go to a specific page (I rather say the ?id=2 will be ?id=1 too ?id=999 or the last row). it cant be done like that tutorial . Link to comment https://forums.phpfreaks.com/topic/160762-confitm-befor-submission-of-a-link/#findComment-848572 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.