本文整理汇总了PHP中comments::updateComments方法的典型用法代码示例。如果您正苦于以下问题:PHP comments::updateComments方法的具体用法?PHP comments::updateComments怎么用?PHP comments::updateComments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comments
的用法示例。
在下文中一共展示了comments::updateComments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
if (isset($_POST['author']) and isset($_POST['content'])) {
$date = time();
if ($_POST['idComments'] == 0) {
$_POST['author'] = trim(htmlentities($_POST['author']));
$_POST['content'] = trim(htmlentities($_POST['content']));
if (empty($_POST['author']) || empty($_POST['author'])) {
$error = 'Merci de remplir tous les champs';
} else {
$comments->addComments($pdo, $date);
header("Location: index.php?pages=viewArticles&&id=" . $_POST['idArticles']);
exit;
}
} else {
$_POST['author'] = trim(htmlentities($_POST['author']));
$_POST['content'] = trim(htmlentities($_POST['content']));
$comments->updateComments($pdo, $date);
header("Location: index.php?pages=viewArticles&&id=" . $_POST['idArticles']);
exit;
}
}
if (isset($_GET['deleteComments'])) {
//Supprimer un article
$comments->deleteComments($pdo);
header("Location: index.php?pages=viewArticles&&id=" . $_POST['idArticles']);
exit;
}
if (isset($_GET['updateComments'])) {
$result = $comments->getComments($pdo);
} else {
$result['author'] = '';
$result['content'] = '';