Merge pull request #6 from mt-site xhtml...
Merge pull request #6 from mt-site xhtml Front page cleanup

File last commit:

6c602be266b6
63a80366de05 merge
Show More
static.php
32 lines | 759 B | text/x-php | XmlPhpLexer
<?php
include('frontend.inc.php');
$qr = mysqli_query($link,'SELECT title, body, style, UNIX_TIMESTAMP(pubdate) AS published, status
FROM static_page
WHERE url_name = "' . mysqli_real_escape_string($link, $_GET['name']) . '"') or die(mysqli_error($link));
$PAGE = mysqli_fetch_assoc($qr);
if(!$PAGE) {
header('HTTP/1.0 404 Not Found');
exit(0);
}
if($PAGE['status'] != 'published') {
header('HTTP/1.0 403 Forbidden');
exit(0);
}
conditional_exit($PAGE['published']);
pagehead('static', $PAGE['title'], $PAGE['style']);
?>
<div class="content">
<h2><?php echo utfentities($PAGE['title']) ?></h2>
<div id="<?php echo utfentities($_GET['name']) ?>">
<?php echo $PAGE['body'] ?>
</div></div>
<?php pagefoot() ?>
</body>
</html>