Forum Moderators: coopster
//paths.inc
<?php
$baseDir = '/www'; // root directory
$includesDir = 'includes/'; // includes directory
$cssDir = 'css/'; // css directory
$jsDir = 'js/'; // js directory
?>
-----
//Shared Server /home/username/www
//contents of /www
css/
stylesheet01.css
stylesheet02.css
images/
image01.gif
image02.gif
includes/
fileHead.inc // [1]
pageFooter.inc // [2]
pageHead.inc // [3]
index.php // [4]
js/
script01.js
script02.js
paths.inc // [5]
<html>
<head>
<title>myRoot.net ¦ <?php echo($title);?></title>
<?php
for ($i=0; $i<count($css); $i++) {// loop through $css array
echo("<link href=\"$cssDir$css[$i]\" ##TRUNCATED CSS LINK## >\n");
}
for ($i=0; $i<count($js); $i++) {// loop through $js array
echo("<script src=\"$jsDir$js[$i]\" ##TRUNCATED SCRIPT TAG##>\n");
}
?>
</head>
===================
[2] pageFooter.inc
===================
<div id="footerDiv">FOOTER CONTENT</div>
=================
[3] pageHead.inc
=================
<div id="headerDiv">
## HEADER CONTENT ##
</div>
==============
[4] index.php
===============
<?php
$title='home';
$js = array('script01.js','script02.js');
$css = array('01.css','02.css');
include('paths.inc');
/* this line calls fileHead.inc, which writes from "<html>"
to "</head>" - fileHead.inc calls the first three vars above*/
include($includesDir . 'fileHead.inc');
?>
<body>
<?php
/*this line calls pageHead.inc, with "page" header content -
(nav, logotype, breadcrumbing, date, etc.)
not to be confused with fileHead.inc which writes "file" head
content (<html><head><title></title><link /></head>) */
include($includesDir . 'pageHead.inc');
?>
<div id="content">BODY CONTENT</div>
<?php /*this line calls pageFooter.inc, which writes "page" footer content
(copyright, contact links, etc.)-- */
include($includesDir . 'pageFooter.inc');
?>
</body>
</html>
I am not totally sure what the question is. That is a chunk of code and I am not totally sure what I am looking for.
I assume you are getting a blank page in the browser for index.php. Have you looked at the page source in your browser to see if the html looks correct or is there no html? Is it including anything?
What results or errors are you getting?
<?php
$baseDir = '/www'; // root directory
$includesDir = 'includes/'; // includes directory
$cssDir = 'css/'; // css directory
$jsDir = 'js/'; // js directory
?>
[edited by: jatar_k at 11:25 pm (utc) on Feb. 2, 2003]
[edit reason] no urls please [/edit]