File: D:/HostingSpaces/EUmans/dak-spouwmuurisolatie.be/wwwroot/landing/index.php
<?php
/**
* index.php
* Created by Komma Mediadesign.
* Author: mike
* Date: 23/07/14
*/
include $_SERVER['DOCUMENT_ROOT'] . '/landing/config/error_report.php';
// Set URL_PAGE (defined in /index.php)
define('URL_PAGE',$pagina);
/**
* Load XML
*/
// Define file
$filename = str_replace('-','_',URL_PAGE);
$file = $_SERVER['DOCUMENT_ROOT'] . '/landing/xml/' . $filename . '.xml.php';
// Check if file exists
if(is_file($file))
{
// Load file
ob_start();
require $file ;
$string = ob_get_contents();
ob_end_clean();
// Get data
$xml = simplexml_load_string($string);
$meta = get_object_vars($xml->meta);
$output = get_object_vars($xml->output);
// Prepare some data
$output['title'] = $meta['title'];
$meta['title'] = strip_tags($meta['title']);
// Prepare image
$file = '/landing/images/' . $filename . '_umans_radepo.jpg';
if(is_file($_SERVER['DOCUMENT_ROOT'] . $file))
{
$image['src'] = $file;
}
else
{
$image['src'] = '/img/product/product_bio.jpg';
}
// alt
$alt = str_replace('_',' ',$filename);
$image['alt'] = ucwords($alt);
// Load Template view
include $_SERVER['DOCUMENT_ROOT'] . '/landing/v_template.php';
}
else
{
// 404
header("HTTP/1.0 404 Not Found");
header("Location: /404");
exit;
}