Hi there
I'm new to php and am trying to create a simple templated site using variables and includes.
I have the template itself, temp.php, which sets up an HTML frameset with variables for each of the three frames:
<?php
//temp.php
print <<<END
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html lang="en">
<frameset rows="108,*,100">
<frame src="$top" name="top" scrolling="no" noresize frameborder="0">
<frame src="$main" name="main" scrolling="yes" noresize frameborder="0">
<frame src="$bottom" name="bottom" scrolling="no" noresize frameborder="0">
</frameset>
</html>
END;
?>
Then I have the page that gets called, main.php, which sets some variables and includes the template
<?php
//main.php
$top= 'top.php';
$main='main2.php';
$bottom= 'bottom.php';
$bott_img='images/kanji_bg.jpg';
$top_img='images/kanji_bg.jpg';
include('temp.php');
?>
The pages, top.php, main2.php and bottom.php contain the HTML for the three frames in the frameset.
What is not happening is that the variables $bott_img and $top_img are not being read into top.php and bottom.php.
Everything else is OK except these images are not being displayed.
bottom.php for instance, looks like this:
<?
// bottom.php
print <<<END
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>title</title>
</head>
<body style="background: url($bott_img) left repeat-x top;">
</body>
</html>
END;
?>
If I actually put the variable
$bott_img='images/kanji_bg.jpg'; into bottom.php then it displays but not if I leave it in main.php
What am I missing? Any clues would be greatly appreciated...
BongoMan