【php开源代码栏目提醒】:本文主要为网学会员提供synewsturn.php,希望对需要synewsturn.php网友有所帮助,学习一下!
<?php require_once('Connections/newpfa.php'); ?>
<?php
$maxRows_news = 5;
$pageNum_news = 0;
if (isset($HTTP_GET_VARS['pageNum_news'])) {
$pageNum_news = $HTTP_GET_VARS['pageNum_news'];
}
$startRow_news = $pageNum_news * $maxRows_news;
mysql_select_db($database_newpfa, $newpfa);
$query_news = "SELECT * FROM bulletins";
$query_limit_news = sprintf("%s LIMIT %d, %d", $query_news, $startRow_news, $maxRows_news);
$news = mysql_query($query_limit_news, $newpfa) or die(mysql_error());
$row_news = my
sql_fetch_assoc($news);
if (isset($HTTP_GET_VARS['totalRows_news'])) {
$totalRows_news = $HTTP_GET_VARS['totalRows_news'];
} else {
$all_news =
mysql_query($query_news);
$totalRows_news = mysql_num_rows($all_news);
}
$totalPages_news = ceil($totalRows_news/$maxRows_news)-1;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>
管理系统 最新公告</title>
<script language="JavaScript" type="text/
JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body background="image/flo17.gif">
<p align="center"><strong><font color="#990000" size="6" face="标楷体">最 新 消 息</font></strong></p>
<table width="98%" height="86" border="1">
<tr>
<td width="25%"><div align="center"><font color="#330099" size="5"><strong><font face="标楷体">公告日期</font></strong></font></div></td>
<td width="26%"><div align="center"><font color="#330099" size="5"><strong><font face="标楷体">公告标题</font></strong></font></div></td>
<td width="49%"><div align="center"><font color="#330099" size="5"><strong><font face="标楷体">公告内容</font></strong></font></div></td>
</tr>
<?php do { ?>
<tr>
<td><div align="center"><font color="#990099" size="4" face="标楷体"><?php echo $row_news['bulletin_date']; ?></font></div></td>
<td><div align="center"><font color="#990099" size="4" face="标楷体"><?php echo $row_news['bulletin_title']; ?></font></div></td>
<td><div align="left"><font color="#990099" size="4" face="标楷体"><?php echo $row_news['bulletin_content']; ?></font></div></td>
</tr>
<?php } while ($row_news = mysql_fetch_assoc($news)); ?>
</table>
<p> </p>
<table width="75%" border="0" align="center">
<?php if ($totalRows_news > 0) { // Show if recordset not empty ?>
<tr align="center" valign="middle">
<td width="26%"><strong><font color="#336600" size="4" face="标楷体">
<?php if ($pageNum_news == 0) { // Show if first page ?>
第一页
<?php } // Show if first page ?>
</font></strong></td>
<td width="22%"><strong><font color="#336600" size="4" face="标楷体">
<?php if ($pageNum_news > 0) { // Show if not first page ?>
上一页
<?php } // Show if not first page ?>
</font></strong></td>
<td width="25%"><strong><font color="#336600" size="4" face="标楷体">
<?php if ($pageNum_news < $totalPages_news) { // Show if not last page ?>
下一页
<?php } // Show if not last page ?>
</font></strong></td>
<td width="27%"><strong><font color="#336600" size="4" face="标楷体">
<?php if ($pageNum_news >= $totalPages_news) { // Show if last page ?>
最後一页
<?php } // Show if last page ?>
</font></strong></td>
</tr>
<?php } // Show if recordset not empty ?>
</table>
<p> </p>
</body>
</html>
<?php
mysql_free_result($news);
?>