Jump to content

Create a confirm dialog box in PHP?


impactdesign

Recommended Posts

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

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>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.