//page for displaying the further reading.
//session needed for links & photo album
session_start();
/***********************************************
* Copyright (c) 2002-4 TheGlasgowStory & HATII *
* Written by Brian Aitken, *
* Re-written 2015 *
***********************************************/
include("../incs/session.php");
include("../incs/error.php");
include("../incs/db.php");
include("../incs/logon.php");
include("../incs/layout.php");
//assign error stuff
$head = "An error has occurred with TheGlasgowStory";
$back = "/";
$backtext = "Either click your browser's 'back' button or click on this link to return to TheGlasgowStory index page";
if($_POST["id"])
$id = htmlspecialchars($_POST["id"]);
else
$id = htmlspecialchars($_GET["id"]);
if(strlen($id)> 7){
dohead($head);
$message = "There is no story for the page to display.
If the problem persists e-mail
webmaster@theglasgowstory.com quoting error code TGSEU002.
";
error($head, $message, $back, $backtext);
}
if(!$id)
{
dohead($head);
$message = "No story was selected.";
error("Problem!", $message, $back, $backtext);
}
$back = "../story/?id=".$id;
//query to get further reading from DB
try{
$q = "select reading from essay where enum = :id";
$stmt = DB::getInstance()->prepare($q);
$stmt->bindParam(':id',$id,PDO::PARAM_STR,7);
$stmt->execute();
$read = $stmt->fetch();
}
catch(PDOException $e){
dohead($head);
$message = "Database error.";
drop_session();
error($head, $message, $back, $backtext);
}
/*******
* HTML *
*******/
format_pre("N", "Further Reading");
?>
No further reading for this story.
"); else echo(stripslashes($read["reading"])); format_post("id",$id);