예제 #1
0
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $data = $article->fetch_data($id);
    //check in case empty results set is returned
    if (!is_array($data)) {
        echo "<h2>Error! Page Not Found!</h2>";
        exit;
    }
    ?>
	<!--display content here!-->
		<!DOCTYPE html>
		<html lang="en">
		<head>
			<meta charset="UTF-8">
			<title><?php 
    echo $sanitize->addUnderScore($data['article_title']);
    ?>
</title>
			<link rel="stylesheet" href="../../assets/style.css">
		</head>
		<body>
			<div class="container">
				<a href="../index.php" id="logo">CMS</a>
				<h4>
					<?php 
    echo $data['article_title'];
    ?>
-
					<small>
						posted <?php 
    echo date('l jS', $data['article_timestamp']);
예제 #2
0
	<meta charset="UTF-8">
	<title>CMS Full</title>
	<link rel="stylesheet" href="assets/style.css">
</head>
<body>
	<div class="container">
		<a href="index.php" id="logo">CMS</a>
		<ol>
			<?php 
foreach ($articles as $article) {
    ?>
				
		
			<li>
				<a href="article/<?php 
    echo $sanitize->addUnderScore($article['article_title']) . '/' . $article['article_id'];
    ?>
"><?php 
    echo $article['article_title'];
    ?>
</a>
				-<small>
				posted <?php 
    echo date('l jS', $article['article_timestamp']);
    ?>
				</small>
			</li>
			<?php 
}
?>
		</ol>