PHP:显示是/否确认对话框 [英] PHP: Show yes/no confirmation dialog

查看:171
本文介绍了PHP:显示是/否确认对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的PHP页面上有一个链接,用于删除一个MySQL表数据.我希望它采用以下方式:当我单击删除"链接时,将出现一个确认框,并询问您确定要删除吗?",并带有两个按钮:是"和否" .当我单击是"时,我要删除MySQL表的数据,而当我单击否"时,什么也不会发生.

My PHP page has a link to delete one MySQL table datum. I want it to be in such a way that when I click the 'delete' link a confirmation box should appear and it should ask "are you sure, you want to delete?", with two buttons: 'yes' and 'no'. When I click yes, I want to delete the MySQL table's data and when I click no, nothing should happen.

推荐答案

<a href="http://stackoverflow.com" 
    onclick="return confirm('Are you sure?');">My Link</a>

这篇关于PHP:显示是/否确认对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆