<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                # 1.新建data_v3/v1/view-post.php文件 ~~~ <?php /** * Emai:y7wanghui@gmai.com * Date: 2020/11/2 0002 */ // htmlspecialchars 將特殊字符轉換為 HTML 實體 // 找出數據庫的路徑,以便SQLite / PDO可以連接 $root = __DIR__; $database = $root . '/../data/data.sqlite'; $dsn = 'sqlite:' . $database; //接收index.php傳過來的id if (isset($_GET['post_id'])){ $postId = $_GET['post_id']; }else{ //總是定義一個id $postId = 0; } // 連接到數據庫,運行查詢,處理錯誤 $pdo = new PDO($dsn); $stmt = $pdo->prepare( 'SELECT title, created_at, body FROM post WHERE id = :id' ); if ($stmt === false) { throw new Exception('準備此查詢時出現問題'); } $result = $stmt->execute( array( 'id'=> $postId,) ); if ($result === false) { throw new Exception('運行此查詢時出現問題'); } $row = $stmt->fetch(PDO::FETCH_ASSOC); ?> <!DOCTYPE html> <html> <head> <title> 我的博客 | <?php echo htmlspecialchars($row['title'], ENT_HTML5, 'UTF-8') ?> </title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> </head> <body> <h1>標題</h1> <h2> <?php echo htmlspecialchars($row['title'], ENT_HTML5, 'UTF-8') ?> </h2> <div> <?php echo $row['created_at'] ?> </div> <p> <?php echo htmlspecialchars($row['body'], ENT_HTML5, 'UTF-8') ?> </p> </body> </html> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看