Advertisement
nicolas-chuet

modal_bdd_ok.php

Apr 1st, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. <?php try { $bdd = new PDO('mysql:host=localhost;dbname=base_test_modal;charset=utf8', 'root', ''); $bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (Exception $e) { echo "erreur"; } $texteBody = $bdd->query('SELECT `texte_modal` FROM `url_modal` WHERE `url` ="'.$_SERVER['HTTP_REFERER'].'"'); $donnee=$texteBody->fetch(); ?>
  2. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">Launch demo modal</button>
  3. <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"><div class="modal-dialog modal-dialog-centered" role="document"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="exampleModalLongTitle">Modal Title</h5><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button></div><div class="modal-body"><?php echo $donnee["texte_modal"]; ?></div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button></div></div></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement