<?php
	session_start();
	include_once 'conn/conn.php';
	$id=$_POST['id'];
	$title = $_POST['title'];
	$cont = $_POST['cont']; 
	if(empty($id) or empty($cont)){
		echo "<script>alert('信息为空，请返回');history.go(-1);</script>";
		exit();
	}
	if(empty($title) or is_null($title)){
		$upsql = "update tb_mess set content = '".$cont."' ";
	}else{
		$upsql = "update tb_mess set title = '".$title."', content = '".$cont."' ";
	}
	$upsql .= "where id = ".$id;
	mysql_query($upsql);
	if(mysql_affected_rows() == 1){
		echo "<script>alert('修改成功');location='index.php';</script>";
		exit();
	}else{
		echo "<script>alert('有错误，请返回');history.go(-1);</script>";
		exit();
	}
?>