Example #1
0
<?php

header("content-type:text/html;charset=utf-8");
include_once 'dbio/NewsTypes.php';
include_once 'dbio/NewsArticles.php';
//获得url中的typeId值
$typeId = $_GET["typeId"];
//通过typeId获得该分类的详细信息
$newsType = NewsTypes::getNewsType($typeId);
//获得该分类下的所有新闻
$newsInfo = NewsArticles::getNewsByTypeId($typeId);
//所有分类(给header用)
$newsTypes = NewsTypes::getNewsTypes();
?>
<html>
  <head>
    <title>天天新闻网</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <link href="css/news.css" type="text/css" rel="stylesheet" />
  </head>
  <body>
    <!-- 网站头 -->
    <?php 
include_once 'header.php';
?>
	
	<!-- 正文内容 -->
	<div class="mainDiv clear">
	  <div class="newsTypeDiv">
	    <div class="newsTypeDiv1">&nbsp;<a href="index.php" class="a">新闻主页</a> &raquo; <?php 
echo $newsType["typeName"];