<?php
session_start();
include("include/inc_smarty.php");
include("include/inc_db_mysql.php");
if($_GET[id]==0){
	backurl('lst.php');
}
 if($_GET[id]!=""){
 $sql= "SELECT `Id`, `ntitle`, `name`, `nsex`, `npic`, `msgdate`, `email`, " .
 		"`msgcontent`, `userip`, `useripadd`, `recont`, `retime`, `rstate`, " .
 		"`rqiao`, `hits` FROM  gz_lstbook where Id=".$_GET[id];		//打开数据库
 $query = $db->query($sql);									//执行SQL语句返回结果
 $row = $db->fetch_row($query);								//一条数据写进数组里ROW用数字标识
 }
 $db->query("UPDATE gz_lstbook set hits=hits+1 where id=".$_GET[id]);
 $upid=$db->backid($_GET[id],'gz_lstbook');
 $neid=$db->nextid($_GET[id],'gz_lstbook');
 $smarty->assign('usrname',$_SESSION["usrname"]);
 $smarty->assign('upid',$upid);							//数组赋值给smarty的upid
 $smarty->assign('neid',$neid);							//数组赋值给smarty的neid
 $smarty->assign('row',$row);							//数组赋值给smarty的row
 $smarty->display("read.htm");							//在哪个页面执行
?>

