熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> PHP編程 >> 正文

PHP網絡開發詳解:頁面代碼設計[1]

2013-11-15 12:41:12  來源: PHP編程 
    ——此文章摘自《完全手冊PHP網絡開發詳解》定價 特價 詳細>>http://tracklinktechcn/?m_id=dangdang&a_id=A&l=&l_type= width= height= border= nosave>

    網站的首頁HTML代碼存放在模板文件中代碼如下所示
    <! 模板文件templates/default/indexincphp >
    <html>
    <head>
    <title>歡迎<?php echo $_SESSION[MM_Username]; ?>使用
    <?php echo $row_rs_config[website_name]; ?></title>
    <meta httpequiv=ContentType content=text/html; charset=gb>
    <style type=text/css>
    <!
    style {
        fontsize: px;
        fontweight: bold;
    }
    >
    </style>
    </head>
    <body>
    <div align=center>
      <p class=style>歡迎<?php echo $_SESSION[MM_Username]; ?>使用
      <?php echo $row_rs_config[website_name]; ?></p>
      <HR>
      <table width= border= cellspacing= cellpadding=>
        <tr>
          <td width= align=left valign=top><?php do { ?>
           <a href=listphp?type_id=<?php echo $row_rs_types[type_id]; ?>>
    <?php echo $row_rs_types[type_name]; ?></a><BR>
          <?php } while ($row_rs_types = mysql_fetch_assoc($rs_types)); ?> </td>
          <td width= align=left><?php do { ?>
            * <a href=showphp?article_id=<?php echo $row_rs_articles [article_
    id]; ?>>
    <?php echo $row_rs_articles[title]; ?></a>(<?php echo $row_rs_articles
    [author]; ?>|
    <?php echo $row_rs_articles[last_upt_time]; ?>) <BR>
          <?php } while ($row_rs_articles = mysql_fetch_assoc($rs_articles)); ?> </td>
          <td width= valign=top>
          <?php
          if(!isset($_SESSION[MM_Username])) {
           ?>   <form name=form method=POST action=<?php echo $loginFormAction; ?>>
            <p align=center>登錄</p>
            <table width= border= cellspacing= cellpadding=>
              <tr>
                <td>用戶名</td>
                <td><input name=username type=text id=username></td>
              </tr>
              <tr>
                <td>密碼</td>
                <td><input name=password type=password id=password></td>
              </tr>
            </table>
            <p align=center>

right>[]  [http://developcsaicn/web/htm>]  [http://developcsaicn/web/htm>]  [http://developcsaicn/web/htm>]  


From:http://tw.wingwit.com/Article/program/PHP/201311/21409.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.