簡單的很~
html頁面
<a href ="你操作php刪除文件的路徑" onclick=" {if(confirm('你確定要刪除<?php echo $v['username']?>嗎?')){rentrn true;}return false;}">刪除</a>
php文件
if($_GET['do']==del){$id = $_GET['id'];$sql = "delect from 數據庫 where id = ".$id;$dsql->ExecuteNoneQuery($sql); echo "<script> alert('刪除成功!');window.location.href='student_voice.php';</script>";}新聞熱點
疑難解答