本文整理汇总了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;
}
示例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;
}
}