impactdesign Posted February 17, 2008 Share Posted February 17, 2008 I am working on an admin page which displays all the data in my db. The admin can update rows or delete rows. I am looking for some advice or coding tips to create a dialogue prompt box if possible in PHP or javascript which will confirm an action like: "Are you sure you want to delete file?" Much like on myphpadmin when you click on the drop icon, a promt box will appear before deleting a file. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/91588-create-a-confirm-dialog-box-in-php/ Share on other sites More sharing options...
wildteen88 Posted February 17, 2008 Share Posted February 17, 2008 You'll have to use javascript for this. Tutorial: http://www.shiningstar.net/articles/articles/javascript/confirmsubmit.asp Link to comment https://forums.phpfreaks.com/topic/91588-create-a-confirm-dialog-box-in-php/#findComment-469129 Share on other sites More sharing options...
spfoonnewb Posted February 17, 2008 Share Posted February 17, 2008 You could use Javascript and/or PHP. For PHP you would just have to carry the data in the $_GET[], or $_POST[] and resubmit it when selecting confirm. Phpmyadmin does both of these. Link to comment https://forums.phpfreaks.com/topic/91588-create-a-confirm-dialog-box-in-php/#findComment-469130 Share on other sites More sharing options...
impactdesign Posted February 18, 2008 Author Share Posted February 18, 2008 Thanks for the tips. I played around with it for serveral hours and I finally got it to work. Here's the code in case anyone wants it. echo'<td class="style2"><a href="delete.php?id='.$rows['id'].'"onclick="javascript:return confirm(\'Are you sure you want to delete this file?\')">Delete</a>';"</td></tr>"; Link to comment https://forums.phpfreaks.com/topic/91588-create-a-confirm-dialog-box-in-php/#findComment-469340 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.