function ifSetGetToDetails() { if (isset($_POST['showId'])) { $id = new GetBook(); $id->getBooksById($_POST['showId']); } }
<?php include $_SERVER["DOCUMENT_ROOT"] . "/head_foot/header.php"; include $_SERVER["DOCUMENT_ROOT"] . "/head_foot/footer.php"; include "../books/GetBook.php"; if (isset($_GET["id"])) { $id = $_GET["id"]; $bookById = new GetBook(); $array = $bookById->getBooksById($id); } ?> <body> <?php $i = 0; while ($i < count($array)) { ?> <h2><?php echo $array[$i]["title"]; ?> </h2> <div name="infos"> <ul> <li>Auteur: <?php echo $array[$i]["author"]; ?> </li> <li>Nombre de pages: <?php echo $array[$i]["pages"]; ?>