<?php include_once "../../controller/user/userController.php"; session_start(); $user = $_SESSION["userSession"]; if (is_null($user)) { header("Location: http://www.andreseloysv.com/happy/index.php"); die; } $date = $_POST['date']; $userController = new userController(); try { $posts = $userController->getLastPost($user->id, $date); for ($index = 0; $index < count($posts); $index++) { ?> <li class="list-group-item old-post"> <div class="media" data-happy="<?php echo $posts[$index]['date']; ?> "> <div> <div class="media-left"> <a href="#"> <img class="media-object img-profile-picture" src="../../image/users/<?php echo $posts[$index]["nick"]; ?> /<?php echo $posts[$index]["photo"]; ?> " height="64px" width="64px" alt="profile picture">