Forum Moderators: coopster
Also, doesn't a conditional statement generally work from a variable or something else in the page that changes? If so, what do I do when the page stays the same and doesn't include variables?
For my site, I've got a page generation class, which creates my pages. The class defines all the methods which generate the page content (header, footer, nav bars, content block, etc..). Then I've got child class definitions on each 'type' of page I want, i.e. a main site page, forums page, whatever..
Something like this.
//class.php
class page {
//class definition
}
//on the pages, i.e. main.php for a main site page
class main_page extends page {
//class definition, methods load content for a 'main' page
}
//on forums.php or forums/main.php or whatever
class forums_page extends page {
//class definition, methods load forum content
}
etc ...
I think it's something like this you want. It may be too complicated, or too simple, I don't know. It works for me..
I'm now using php includes to do some of what I want but I get a parse error at this line:
<?xml version="1.0" encoding="iso-8859-1"?>
If I take it out eveything works, but all my styles and stuff get a little wacked out. Any ideas how to fix that?
Basically the '<?' in "<?xml version="1.0" encoding="iso-8859-1"?>" has the interpreter expecting php code (starting with the <?php tag), and, obviously 'xml version.. etc' doesn't parse as correct php.
To get round this, just output the xml tag like so:
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";?>
Or put your html in a seperate file which won't be parsed as php, i.e. with an extension of '.htm' ..
fwiw, I did find out that "<?xml version="1.0" encoding="iso-8859-1"?>" isn't needed unless you plan to output your pages in xml, BUT it can cause IE to do buggy things.
I think that's why my styles change when I remove it...they change to what they really are rather than what IE thinks they are when the xml line is in there.