Why Won't My PHP Code Using Include Not Work!?

Cian Brassinne

New member
The problem is that when I include my template.php file into my index.php file nothing is included even though php actually finds the file (template.php).
When I look at the source code of my index.php file from my web-browser there is nothing from the template.php file even though it is mostly html...
PLEASE HELP



Check out this index.php file and tell me what could be improved please:

<?php

$title = null; // 'Wassa People'
$metatag_description = null;
$metatag_keywords = null;
$stylesheet_css = null; // 'http://www.cianb.co.cc/1/css/main.css'
$body_content = null; // 'http://www.cianb.co.cc/1/incl/body/home.php'

if (!file_exists('1/incl/template.php'))
{
$msg = 'Sorry for the inconveniences but this site is having technical difficulties. Please return in a while to see if it works or send a message to [email protected]';
echo $msg;
?>

<script type="text/javascript">
alert("<?php echo $msg; ?>");
</script>

<?php
die();
}
else
{
?>

<script type="text/javascript">
alert("Hi how ya doing there buddy");
</script>

<?php
include('1/incl/template.php');
}

?>



If I were to include this file (template.php):

<!DOCTYPE HTML>

<html>

<head>

<title><?php echo $title; ?> | Cianb.co.cc</title>

<link rel="stylesheet" type="text/css" href="<?php echo $stylesheet_css; ?>" />

<meta name="description" content="<?php echo $metatag_description; ?>" />
<meta name="keywords" content="<?php echo $metatag_keywords; ?>" />
<meta name="author" content="Cian Christian Brassinne" />

</head>





<body>









wassa

<?php include($body_content;) ?>

wassa2









</body>

</html>
 
Back
Top