• <label id="pxtpz"><meter id="pxtpz"></meter></label>
      1. <span id="pxtpz"><optgroup id="pxtpz"></optgroup></span>

        當前位置:雨林木風下載站 > 技術開發教程 > 詳細頁面

        新聞公布系統 (例子) 一 news

        新聞公布系統 (例子) 一 news

        更新時間:2022-05-16 文章作者:未知 信息來源:網絡 閱讀次數:

        <?
        /*
        News Donkey v1.0d8b db d88888b db d8b db .d8888.
        by Oscar Rylin [oscar@mgon.com] 888o88 88' 88 I8I 88 88'YP
        88V8o 88 88ooooo 88 I8I 88 `8bo. 
        88 V8o88 88~~~~~ Y8 I8I 88 `Y8b.
        88V888 88. `8b d8'8b d8' db 8D
        VP V8P Y88888P`8b8' `8d8'`8888Y'
         
         
        d8888b..d88b.d8b db db dD d88888b dbdb
        88`8D .8PY8. 888o88 88 ,8P' 88' `8bd8'
        88 88 8888 88V8o 88 88,8P 88ooooo`8bd8'
        88 88 8888 88 V8o88 88`8b 88~~~~~88
        88.8D `8bd8' 88V888 88 `88. 88.88
        Y8888D'`Y88P'VP V8P YP YD Y88888PYP

        This script was made by Oscar Rylin (oscar@mgon.com) while learning PHP w/
        MySQL connections.

        What the script Does:
         * Provides an easy way to Read news from a MySQL database
         * Prints it out in a nice HTML format which is customizable
         * Provides a secure interface (user/password validation through a MySQL db)
         * Updating news, deleting and adding users and lots of other stuff
        */

        include "dbconn.php"; // This is http://zend.com/codex.php?id=35&single=1
        include "settings.php"; // The settings file
        ?>

        <html>
        <head>
        <title>newsM0nger1.0</title>
        <style type="text/css">
         .section { font-weight: bold; font-size:10pt; }
         .newsTxt { font-weight: normal; font-size:10pt; color: #ffffff; font-family: verdana; }
         a{ font-weight: bold; font-size:10pt; color: #ffffff; font-family: verdana; }
         a.normal { font-weight: bold; font-size:10pt; color: #000000; font-family: verdana; }
        </style>
        </head>
        <body bgcolor="white">
        <? print $header; ?>
        <center>
         <table border="1" cellpadding="0" cellspacing="0" bordercolor="black">

        <?

        $db = mysql_connect($dbHost, $dbUser, $dbPass);
        mysql_select_db($dbName,$db);
        $result = mysql_query("select count(id) as Total from news",$db);
        $row = mysql_fetch_array($result);
        mysql_close($db);

        if ($row[Total] > 5) {
        $pCount = 0;
        print "<b>Archive</b> ?";
        print "<a href=\"$PHP_SELF?start=0\" class=\"normal\">Main</a> ";
        while ($pCount < ($row[Total]/5)-1) {
         ++$pCount;
         print "<a href=\"$PHP_SELF?start=". ($pCount*5) ."\" class=\"normal\">$pCount</a> ";
        }
        }

        $tmpDL = 0;

        $sql = new CDBMySQL($dbHost, $dbUser, $dbPass, $dbName);
        if ($start) {
         $sql -> Query ("SELECT * FROM news WHERE id < ". ($row[Total] - $start) . " ORDER BY id DESC");
        } else {
        $sql -> Query ("SELECT * FROM news ORDER BY id DESC");
        }

        while (($sql -> ReadRow()) && ($tmpDL < $newsDL)){
         
         $id = ($sql -> RowData["id"]);
         $date = ($sql -> RowData["date"]);
         $poster = ($sql -> RowData["user"]);
         $header = ($sql -> RowData["header"]);
         $news = ($sql -> RowData["news"]);
         $news = nl2br($news);

         $uDB = new CDBMySQL($dbHost, $dbUser, $dbPass, $dbName);
         $uDB -> Query ("SELECT * FROM users where user=\"$poster\"");

         while ($uDB -> ReadRow()){
        $email = ($uDB -> RowData["email"]);
         }
         $uDB -> Close();
         
         $format = "

        <tr>
        <td width=\"579\" height=\"20\" background=\"section.gif\" class=\"section\" colspan=\"2\">
         <font color=\"white\">$date</font>   -  <font color=\"#003366\">$header</font>
        </td>
        </tr>

        <tr>
        <td bgcolor=\"#666688\" class=\"newsTxt\" colspan=\"2\">
        $news
        <br>
        -- <a href=\"mailto:$email\">$poster</a>
        </td>
        </tr>

        <tr>
        <td bgcolor=\"#ffffff\" height=\"20\" colspan=\"2\">
        </td>
        </tr>
        ";
         print "$format";
         ++$tmpDL;
        }
        //$sql -> Close();
        ?>

        <table border="0" cellpadding="0" cellspacing="0" width="579">
         <tr><td width="50%" align="left"><img src=http://cfan.net.cn/info/"php.gif"></td><td width="50%" align="right"><img src=http://cfan.net.cn/info/"mysql.gif"></td></tr>
         
        </center>
        <? print $footer; ?>
        </body>
        </html>

        溫馨提示:喜歡本站的話,請收藏一下本站!

        本類教程下載

        系統下載排行

        主站蜘蛛池模板: 国内精品免费视频精选在线观看| 亚洲人成色4444在线观看| 美女裸体无遮挡免费视频网站| 国产成人午夜精品免费视频| 337p日本欧洲亚洲大胆精品555588| 最近更新免费中文字幕大全| 亚洲?V无码乱码国产精品| 亚洲AV日韩综合一区| 国产美女无遮挡免费视频| 亚洲AV永久无码精品一福利 | 拔擦拔擦8x华人免费久久| 亚洲影院天堂中文av色| 中国在线观看免费国语版| 亚洲午夜一区二区三区| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 黄色永久免费网站| 亚洲日本久久久午夜精品| 天天看片天天爽_免费播放| 国产精品亚洲综合天堂夜夜| 亚洲国产成人精品久久久国产成人一区二区三区综 | 亚洲精品国产高清在线观看| 免费看国产精品麻豆| 一区二区免费电影| 亚洲人成在线播放网站| 久久国产免费观看精品3| 亚洲一级在线观看| 日韩特黄特色大片免费视频| 一级毛片在线免费播放| 亚洲人成在线播放网站岛国| 无码少妇一区二区浪潮免费| 亚洲日韩AV一区二区三区四区| 亚洲精品国产精品乱码不卡| av永久免费网站在线观看 | 美国毛片亚洲社区在线观看 | 一区二区三区视频免费观看| 日韩精品一区二区亚洲AV观看| 成人毛片免费观看视频在线 | 亚洲电影免费观看| 立即播放免费毛片一级| 亚洲免费视频网站| 四虎影库久免费视频|