首頁 >php教程 >php手册 >删除前添加确认删除弹出框

删除前添加确认删除弹出框

WBOY
WBOY原創
2016-06-13 09:43:59837瀏覽

简单的很~

html页面

<span <</span><span a </span><span href </span><span ="你操作php删除文件的路径"</span><span  onclick</span><span =" {if(confirm('你确定要删除<?php echo $v['username']?>吗?')){rentrn true;}return false;}"></span><span 删除</a</span><span ></span>

php文件

<span if</span>(<span $_GET</span>['do']==<span del){
</span><span $id</span> = <span $_GET</span>['id'<span ];
</span><span $sql</span> = "delect from 数据库 where id = ".<span $id</span><span ;
</span><span $dsql</span>->ExecuteNoneQuery(<span $sql</span><span );
    </span><span echo</span> "<script> alert('删除成功!');window.location.href='student_voice.php';</script>"<span ;
}</span>
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn