Add a delete confirmation pop-up box before deletion_PHP tutorial

WBOY
Release: 2016-07-13 10:39:43
Original
1050 people have browsed it

It’s very simple~

html page

<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>
Copy after login

php file

<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>
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/729833.htmlTechArticleIt’s very simple~ html page php file (['do']== = ['id' = "delect from database where id = ". -ExecuteNoneQuery( "script alert('Delete successfully!');window.location.href='student_voi...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template