[CLUE-Tech] PHP or CSS question

Joe 'Zonker' Brockmeier jbrockmeier at earthlink.net
Sat Nov 17 20:01:28 MST 2001


On Sat, 17 Nov 2001, Kevin Cullis wrote:

> Joe 'Zonker' Brockmeier wrote:
> >
> > On Sat, 17 Nov 2001, Dave Anselmi wrote:
> >
> > > Kevin Cullis wrote:
> > >
> > > > Hi all,
> > > >
> > > > I'm trying to learn PHP, in a small way, and would like to determine
> > > > whether CSS or PHP would be best for my situation.
> > >
> > > Can you do headers/footers in CSS?  For example, if I want the same menu
> > > bar on every page, it's easy to do a php include to get it.  But how in
> > > CSS?
> >
> > CSS won't automagically include headers and footers, use PHP for
> > that. But, you'll probably want to use the same stylesheets for most
> > or all of your pages, so you would use PHP to include the CSS in
> > each page...
> >
> > CSS isn't a programming language, it's a formatting language. PHP
> > and CSS work well together -- they don't perform the same functions.
>
> The key issue that I'm wondering is: "in the HTML beginning", each and
> every style was located throughout a "document" while CSS now locates
> styles in one place, could PHP, without the use of CSS, just allow me to
> design just one footer that has all of the normal HTML tags but use PHP
> to "call" the one file throughout the web site. I'm trying to think
> outside of a CSS/PHP box here: could a normal footer (such as company
> name, address, and email address on each web page) be "cut and pasted"
> into a PHP code that would have the simple HTML code displayed for each
> page?

Yes, this is pretty trivial to do with PHP. All you need is something
like

<?
include("footer.html");
?>

in each file on your site that you want to have a footer.

And have all the footer stuff located in "footer.html"

Zonker
--
Joe 'Zonker' Brockmeier -=- jbrockmeier at earthlink.net
http://www.DissociatedPress.net/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Life moves pretty fast. If you don't stop and look around
once in awhile, you could miss it." -- Ferris Bueller




More information about the clue-tech mailing list