PHP Classes

File: page.php

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   Giga CMS   page.php   Download  
File: page.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Giga CMS
Multi-user content management system
Author: By
Last change:
Date: 7 years ago
Size: 1,634 bytes
 

Contents

Class file image Download
<?php
include "inc/init.php";

$servername = "$set->db_host";
$username = "$set->db_user";
$password = "$set->db_pass";
$dbname = "$set->db_name";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die(
"Connection failed: " . $conn->connect_error);
}

$url_get=mysql_real_escape_string($_GET['url']);
$url=$url_get.'.html';
$result_title = mysqli_query($conn, "SELECT * FROM `".MLS_PREFIX."page` WHERE `link`='$url'")
or die(
mysqli_error());

// loop through results of database query, displaying them in the table
       
while($row = mysqli_fetch_array( $result_title )) {
       
       
// echo out the contents of each row into a table
       
$title = $row['title'];
       
$description = $row['description'];
       
$keyword = $row['keyword'];
       
    }

$page->title = $title;
$page->description = $description;
$page->keyword = $keyword;



include
"header.php";


if(
$_GET['url'])
{

$url=mysql_real_escape_string($_GET['url']);
$url=$url.'.html';
$result_content = mysqli_query($conn, "SELECT * FROM `".MLS_PREFIX."page` WHERE `link`='$url'")
    or die(
mysqli_error());
   
$count=mysqli_num_rows($result_content);
$row=mysqli_fetch_array($result_content);


$content = $row['content'];

}
else
{
echo
'404 Not URL Available.';
}


if(
$count)
{
echo
'
<div id="fh5co-main">
<div style="padding-top:100px">
<div class="container">
'
.$content.'
</div>
</div>
<div class="fh5co-spacer fh5co-spacer-lg"></div>'
;

}
else
{
echo
"<h1>Not URL Available 404.</h1>";
}


   
include
"footer.php";
?>