<?php session_start(); include 'conn/conn.php'; $id=$_GET['id']; $delsql = "delete from tb_mess where id = ".$id; $rst = mysql_query($delsql); if(mysql_affected_rows() == 1){ echo "<script>alert('删除成功');location='".$_SERVER['HTTP_REFERER']."';</script>"; }else{ echo "<script>alert('已删除');location='".$_SERVER['HTTP_REFERER']."';</script>"; } ?>