include 'conn.php'; $id = $_GET['id']; $query="delete from message where id=".$id; mysql_query($query); ?> //页面跳转,实现方式为javascript $url = "list.php"; echo ""; ?>
preEdit.php
复制代码 代码如下:
include 'conn.php'; $id=$_GET[id]; $query="SELECT * FROM message WHERE id =".$id; $result=mysql_query($query); while ($rs=mysql_fetch_array($result)){ ?>
postEdit.php
复制代码 代码如下:
include 'conn.php'; $query="update message set user='$_POST[user]',title='$_POST[title]',content='$_POST[content]' where id='$_POST[id]'"; mysql_query($query); ?> //页面跳转,实现方式为javascript $url = "list.php"; echo ""; ?>