$_SESSION["title"] = htmlspecialchars(trim($_POST["searchKey"])); unset($_POST["searchKey"]); } //assume sent by controller and session is not empty $title = $_SESSION["title"]; $modelMethods = new Model(); $exists = $modelMethods->titleExists($title); if ($exists === FALSE) { header("Location:error.php"); exit; } $overallInfo = $modelMethods->getOverallInfoFor($title); $overviewImageFileName = $overallInfo['imageFileName']; $director = $overallInfo['director']; $mpaaRating = $overallInfo['mpaaRating']; $score = $modelMethods->getScore($title); $year = $overallInfo['year']; $runtime = $overallInfo['runtime']; $boxOffice = $overallInfo['boxOffice']; if ($score >= 60) { $scoreImage = "images/freshlarge.png"; $scoreImageAlt = "FRESH"; } else { $scoreImage = "images/rottenlarge.png"; $scoreImageAlt = "ROTTEN"; } ?> <h1><?php echo $title . " (" . $year . ")"; ?> </h1>