Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('config.php');
- if (!isset($_GET['id']))
- {
- header('Location: index.php');
- }
- else
- {
- $id_get = intval($_GET['id']);
- }
- $v1 = $bdd->query('SELECT id, titre, auteur, contenu FROM articles WHERE id ="'.$id_get.'" ');
- $donnees = $v1->fetch();
- if (isset($donnees['id'])){
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <HTML dir="ltr" lang="fr-FR">
- <title>Blog T.A games studio</title>
- <link rel="stylesheet" href="styleblog.css" />
- </head>
- <body>
- <div id="blocpage">
- <header>
- <h2> <?php echo strip_tags($donnees['titre']); ?> </h1>
- <p><?php echo nl2br(strip_tags($donnees['contenu'])); ?></p>
- <h5><em> par : <?php echo strip_tags($donnees['auteur']);?> </em></h5>
- <br/>
- </header>
- <h2>Commentaires : <br/>
- - - - - - - - - - - - -</h2>
- <?php
- $v2 = $bdd->query('SELECT id, auteur, contenu, id_article FROM commentaires WHERE id_article = "'.$donnees['id'].'" ');
- while($info_com = $v2->fetch()) { ?>
- <em><h5> <?php echo strip_tags($info_com['auteur']); ?> ecrit : <br/>
- <?php echo nl2br(strip_tags($info_com['contenu'])); ?></em></h5><br/>
- <hr/>
- <?php
- }
- ?>
- <form action="postcomm.php" method="post">
- Votre pseudo :<br/>
- <input type="text" name="auteur" id="auteur" maxlenght="12"/> <br/>
- Votre commentaire : <br/>
- <textarea name="contenu" id="contenu"></textarea>
- <input type="submit" name="envoyer" value="Commenter !"/>
- <input type="hidden" name="id_article" value="<?php echo $donnees['id']; ?>" />
- </form>
- </div>
- </body>
- </html>
- <?php }
- else
- {
- echo '<h1>ID non existant (La page n\'existe pas) . </h1>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement