當前位置: 首頁>>代碼示例>>PHP>>正文


PHP check::check1方法代碼示例

本文整理匯總了PHP中check::check1方法的典型用法代碼示例。如果您正苦於以下問題:PHP check::check1方法的具體用法?PHP check::check1怎麽用?PHP check::check1使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在check的用法示例。


在下文中一共展示了check::check1方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

 function __tostring()
 {
     $input1 = "";
     if ($this->number == 0) {
         $input1 .= "<script>alert('查不到');history.back();</script>";
     } else {
         foreach ($this->info as $value) {
             $sql = "select * from t_wz";
             $f = new check($sql);
             $input1 .= "<div class='post' id='post-001'>";
             $input1 .= "<h1>" . $value['title'] . "</h1>";
             $input1 .= "<small>" . $value['sj'] . "|</small> <a>分類:" . $value['kind'] . "</a>";
             $input1 .= "<div id='rensheng'><img src='../img/" . $value['id'] . ".jpg'></div>";
             $input1 .= "<div id='comments'><a href='blog_main.php?action=article2&id=" . $value['id'] . "'>readermore</a> <a>|</a><a>comments(" . $f->check1($value['id']) . ")</a></div>";
             $input1 .= " </div>";
         }
     }
     return $input1;
 }
開發者ID:JiaJia01,項目名稱:homework_09,代碼行數:19,代碼來源:checkone.class.php

示例2: article2

 private function article2()
 {
     $sql = "select* from t_wz where id='{$_GET['id']}'";
     $sql2 = "select*from t_pl where wzid='{$_GET['id']}'";
     $info = $GLOBALS['dbk']->query($sql);
     $input .= "<div class='post' id='post-005'>";
     foreach ($info as $value) {
         $author = $value['author'];
         $input .= "<h1>" . $value['title'] . "</h1>";
         $input .= "<small>" . $value['sj'] . "|";
         $input .= "<a>分類:" . $value['kind'] . "</a>|<a>作者:" . $value['author'] . "</a></small><br/><br/>";
         $input .= "<div id='meiguo'>" . $value['content'] . "</div><hr/>";
         $sql = "select * from t_wz ";
         $f = new check($sql);
         $input .= "<div id='comments'><h1 >" . $f->check1($value['id']) . "  Comments</h1></div><br/>";
         $id = $value['id'];
         if ($_SESSION['name'] == $author) {
             $info = 'wz';
             $input .= "<div id='comments'><a href=\"del.php?id={$id}&info={$info}\" onclick=\"if(confirm('確實要刪除此條記錄嗎?')) return true;else return false; \">刪除文章</a></div>";
             $input .= "<div id='comments'><a href=\"mod.php?id={$id}&info={$info}\" onclick=\"if(confirm('確實要修改此條記錄嗎?')) return true;else return false; \">修改文章</a></div><br/><br/><br/>";
         }
     }
     if ($info2 = $GLOBALS['dbk']->query($sql2)) {
         if ($info2->rowCount() == 0) {
             $input .= "暫無評論";
         } else {
             $input .= "<ol class='commentlist'>";
             foreach ($info2 as $value) {
                 $input .= "<li class='alt' id='comment-7796'>";
                 $input .= "From <cite><a >" . $value['name'] . "</a></cite>";
                 $input .= "<div class='commentdata'>";
                 $input .= "<p>" . $value['content'] . "</p>";
                 $input .= "<div class='clear'></div></div>";
                 $id = $value['id'];
                 if ($_SESSION['name'] == $author || $_SESSION['name'] == $value['name']) {
                     $info = 'pl';
                     $input .= "<p><a href=\"del.php?id={$id}&info={$info}\" onclick=\"if(confirm('確實要刪除此條記錄嗎?')) return true;else return false; \">刪除評論</a></p>";
                     $input .= "<p><a href=\"mod.php?id={$id}&info={$info}\" onclick=\"if(confirm('確實要修改此條記錄嗎?')) return true;else return false; \">修改評論</a></p>";
                     $input .= "</li>";
                 }
                 $input .= "<hr/>";
                 $input .= "</ol>";
             }
         }
         $input .= "<div id='respond'><h1 >Add a comment</h1></div>\n    <form action='' method='post' id='commentform'>\n    <fieldset>\n    <label for='comment'>Comment:</label>\n\n    <textarea name='comment' id='comment' cols='100%' rows='10' tabindex='4'></textarea>\n    <script type='text/javascript'>CKEDITOR.replace('comment');</script>\n    </fieldset>\n    <fieldset>\n    <input name='submit2' type='submit' id='submit' tabindex='5' value='Post Comment' />\n    <input type='hidden' name='comment_post_ID' value='308' />\n    </fieldset>\n\n    </form>";
         $input .= "</div>";
         if (!empty($_SESSION['name']) && isset($_POST['submit2'])) {
             $sql = "insert into t_pl(name,content,wzid)values('{$_SESSION['name']}','{$_POST['comment']}','{$_GET['id']}')";
             if ($GLOBALS['dbk']->exec($sql)) {
                 $input .= "<script>alert('插入成功');;history.back();</script>";
             }
         } else {
             if (isset($_POST['submit2'])) {
                 $sql = "insert into t_pl(name,content,wzid)values('遊客','{$_POST['comment']}','{$_GET['id']}')";
                 if ($GLOBALS['dbk']->exec($sql)) {
                     $input .= "<script>alert('插入成功');</script>";
                 }
             }
         }
         return $input;
     }
 }
開發者ID:JiaJia01,項目名稱:homework_09,代碼行數:62,代碼來源:triangle.class.php


注:本文中的check::check1方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。