Home  >  Article  >  Backend Development  >  Add a delete confirmation pop-up box before deletion_PHP tutorial

Add a delete confirmation pop-up box before deletion_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:39:431049browse

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>

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>

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...
Statement:
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