Exemplo n.º 1
0
<?php

if ($access != 'VALID') {
    header('location:../../index.php');
}
$retour = '';
if (isset($_POST['content'])) {
    include_once 'model/blog/fonctions_blog.php';
    if (ajout_commentaire($_GET['b'], $_POST['content'], $_SESSION['id'])) {
        $retour = 'Votre commentaire a été ajouté';
    } else {
        $retour = "Il y a eu une erreur lors de l'ajout de votre commentaire";
    }
} else {
    $retour = 'Il y a eu une erreur lors du traitement, veuillez réessayer';
}
$location = "location:?module=blog&amp;action=article&amp;b=" . $_GET['b'];
header($location);
Exemplo n.º 2
0
<?php

include 'lib/user.php';
include 'lib/PDO.php';
if (!empty($_POST['action']) && $_POST['action'] == 'ajout') {
    include_once 'modele/news/ajout_commentaire.php';
    ajout_commentaire($_POST['message'], $_GET['news'], $_POST['id_auteur'], $_POST['nom_auteur']);
}
//On on recupere la news qui nous interesse
include_once 'modele/news/get_particular_news.php';
$particular_news = get_particular_news($_GET['news']);
//On recupere les commentaires correspondants a la news
include_once 'modele/news/get_commentaires.php';
$commentaires = get_commentaires($_GET['news']);
//affichage de la news, commentaires + formulaire ajout commentaires
include 'vue/news/news.php';