发新话题
打印

请求帮助!如何在设定好的表格或表单中实现7个文件链接

请求帮助!如何在设定好的表格或表单中实现7个文件链接

单位要做新闻类的web网站,如何在设定好的工作动态表格或表单中实现7个文件链接,有参考代码,怎么修改代码,谢谢。只要从mysql库中调用“工作动态”分类中的7个文件链接,如果单击某个新闻标题链接,则进入相应的新闻浏览页。新发布的新闻会后来居上,超过7个,则下方的新闻标题被挤出。
如图

可以参考的代码
引用:

<!--工作动态-->
        <tr>
          <td width="410" height="33" background="images/GNewtop.gif" bgcolor="#ffffff"><div align="justify"><span class="xxcx"> ◎工作动态</span></div></td>
          </tr>
        <td height="257" valign="top">
            <?php
mysql_data_seek ( $rsCategory, 0 );
$row_rsCategory = mysql_fetch_assoc($rsCategory);
do {
  // 创建记录集rsNews
  $sql2 = sprintf ( "SELECT * FROM newsinfo WHERE CategoryID=%d ORDER BY IssueTime DESC LIMIT 8",
    $row_rsCategory['CategoryID'] );
  $rsNews = mysql_query ( $sql2 ) or die ( mysql_error() );
  $row_rsNews = mysql_fetch_assoc ( $rsNews );
  $totalRows_rsNews = mysql_num_rows ( $rsNews );
  if ( $totalRows_rsNews > 0 ) {
    printf ( "<table align=\"center\" border=\"0\" width=\"96%%\" rules=\"none\">\n" );
    printf ( "<tr bgcolor=\"#cccccc\">" );
    printf ( "<td align=\"center\">%s</th>\n", $row_rsCategory['CategoryName'] );
    printf ( "<td align=\"center\"><a href=\"classify.php?cid=%d&cname=%s\">更多%s...</a></td>\n",
      $row_rsCategory['CategoryID'],
          urlencode ( $row_rsCategory['CategoryName'] ),
          $row_rsCategory['CategoryName'] );
    do {
      printf ( "<tr>\n" );
      printf ( "<td colspan=\"2\">" );
          printf ( " ·<a href=\"shownews.php?nid=%d&cname=%s\" target=\"_blank\">%s</a>",
            $row_rsNews["NewsID"],
                urlencode ( $row_rsCategory['CategoryName'] ),
                $row_rsNews["Title"] );
          printf ( "<font color=\"#aaaaaa\">(%s)</font></td>", $row_rsNews["IssueTime"] );
      printf ( "</tr>\n" );
    } while ( $row_rsNews = mysql_fetch_assoc ( $rsNews ) );
    printf ( "</table>\n" );
  } else {
    continue;
  }
} while ($row_rsCategory = mysql_fetch_assoc($rsCategory));
?>
</p>

TOP

你说的7个文件链接是什么意思啊,还有你的代码风格真是太不好了

TOP

我才开始学,代码是从别的地方找的,想直接套用,但是不是我想的那样。
“7个文件链接”就是在工作动态栏里能够最多显示发布的7个文件的标题和日期,当点击任何一个文件标题是能够打开文件的浏览窗口。

TOP

你可以把你想实现的功能画一画,我理解能力有限,哈

TOP

发新话题