[thelist] Re: php include

Russell Griechen russgri at bellsouth.net
Wed Jan 22 15:15:05 CST 2003


Thanks Daniel and Martyn
Narrowing the focus:
I have the file:
head.inc or head.php or head.inc.php  //which should I save it as.
and further...
Current Directory:/home/russgri/www/head.inc    //I assume
next we have:
<?php
include('!paths.inc');
include($includesDir . 'fileHead.inc'); // writes file head using 1st 3 vars
?>
// I assume:
File/Save As/home/russgri/include/path.inc  // to allow global rather than
relative urls

or Current Directory:/home/russgri/www/include // to allow relative urls

// Then to call footer:
<? include($includesDir . 'pageFooter.inc');?>
// I would then edit the path.inc file to reflect the added footer.inc url:
<?php
include('!paths.inc');
include($includesDir . 'fileHead.inc'); // writes file head using 1st 3 vars
include($includesDir . 'fileFooter.inc');  //writes file footer using last
var
?>
Thanks in advance for walking me thru this.

Russell Griechen.//Daniels relevant example template is below.
<?php
$title ='home'; // title of this page, passed to fileHead.inc
$css  = array('stylesheet01.css','stylesheet02.css'); // writes css file(s)
include('!paths.inc'); // file that contains vars that contain paths
relative to this file
include($includesDir . 'fileHead.inc'); // writes file head using 1st 3 vars
?>

<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">

<!-- PAGE HEAD -->
<? include($includesDir . 'pageHead.inc');?> // writes page head content

<!-- PAGE BODY -->
<div id="bodyDiv">
## body content ##  <!-- includes static and dynamic content -->
</div>

<!-- PAGE FOOTER -->
<? include($includesDir . 'pageFooter.inc');?> // writes page footer

</body>
</html>





More information about the thelist mailing list