<?php 
require_once 'conn.php';
require_once 'function.php';
$id=$_GET['id'];
$row=query("select * from news where id='$id'");
$click=$row['click']+1;
mysql_query("update news set click='$click' where id='$id'");
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>
<title><?=$row['title']?></title>
<meta name="keywords" content="<?=$site['keywords']?>"/>
<meta name="description" content="<?=$site['description']?>"/>
<meta name="referrer" content="no-referrer" />
<link rel="stylesheet" href="/css/index.css">
<link rel="stylesheet" href="/page.css">
<link rel="stylesheet" href="/css/bootstrap.min.css">
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap.min.js"></script>
<style>
.navbar { margin-bottom:0px;}
.panel-body img { max-width:100%;}
h1 { color:blue;}
</style>
</head>
 
<body>
<?php 
require_once 'head.php';	
?>
<div class="container">
  <div class="box">  
    <div class="row">
			 <div class="panel panel-default">
					<div class="panel-heading">
						    <h3><?=$row['title']?></h3> 
					</div>
					<div class="panel-body">					       
							<p>发布时间 <?=$row['time']?></p>
							<p>点击 <?=$row['click']?></p> 				
						<?php
						echo $c=$row['content'];						
						?>
						
						<?php 
						$sid=$_GET['id']-1;
						$rows=query("select * from news where id='$sid'");									
						?>
						<br>
						<p>上一篇：<a href="/show/<?=$rows['id']?>.html"><?=$rows['title']?></a></p>
						<?php 
						$xid=$_GET['id']+1;
						$rowx=query("select * from news where id='$xid'");						
						if($rowx){
						?>
						<p>下一篇：<a href="/show/<?=$rowx['id']?>.html"><?=$rowx['title']?></a></p>
						<?php
						}else{
						?>
						<p>下一篇：没有了</p>
						<?php
						}			
						?>
					</div>
			</div>
    </div>
	
	
	
	<?php 
	require_once 'foot.php';
	?>
	
	<!--我的代码结束-->
  </div>
</div>

</body>
 
</html>