-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.php
35 lines (33 loc) · 966 Bytes
/
page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require_once ("Includes/simplecms-config.php");
require_once ("Includes/connectDB.php");
include("Includes/header.php");
?>
<div id="main">
<?php
$pageid = $_GET['pageid'];
$query = 'SELECT menulabel, content FROM pages WHERE id = ? LIMIT 1';
$statement = $databaseConnection->prepare($query);
$statement->bind_param('s', $pageid);
$statement->execute();
$statement->store_result();
if ($statement->error)
{
die('Database query failed: ' . $statement->error);
}
if ($statement->num_rows == 1)
{
$statement->bind_result($menulabel, $content);
$statement->fetch();
echo "<h2>$menulabel</h2> $content";
}
else
{
echo 'Page Not Found';
}
?>
</div>
</div> <!-- End of outer-wrapper which opens in header.php -->
<?php
include ("Includes/footer.php");
?>