I'm just getting started with php 4.03. Yes I've read the FAQ
and lots of documentation.

I have setup my pages so they all look more or less like this:

    <?php require("mylib.php"); ?>
    <html>
    <head>
     <?php myheader("this is the title"); ?>
     <meta name="keywords" content="apples, oranges">
    ...
    </head>
    <?php mybody("this is the title"); ?>
    <p>here is the body of the page</p>
    <?php myfooter(); ?>
    </html>

Just for the record, there is a lot of php code in mybody() to emit
HTML code for top & side nav bars etc.

My questions are:
1. every page on the site has:
    require("mylib.php");
at the top of the page to provide access to the functions contained
therein. Is require() correct or should I use include()?

2. should mylib.php be called mylib.inc instead? It works fine
as mylib.php. If I use include() instead  of require() would the
filename extension be different, i.e. mylib.inc?

3. I pass the same title to myheader() and to mybody() as shown
above. In the first case, it is emitted as <title>...</title> and in the
2nd case is it emitted as <h1>...</h1>. Is there a way to set this
up so I only need to have one instance of the title passed to
a function?

4. I have some of the HTML <xxx> tags in the code (i.e.
<title>, <body> and some in the actual xxx.php page, i.e.
<html>, <head> (as above). I suppose myheader() could
have emitted <html><head> and myfooter() could have
emitted </html>. I'm trying to develop some sense of style
for this, but I'm working in a vacuum. Are there any opinions
or guidelines on how to write php code in terms of which tags
are visible in the page and which tags are emitted by functions
in other modules?

5. I see there is a php.template newsgroup, but I couldn't really
follow the conversations. Is that group for discussing ways to
implement a design template in php so that all pages have the
same appearance? I guess that's what I'm doing with my
mylib.php module - the functions dump out the same nav bars
to every page.

Thanks.

--
John A. Grant  * I speak only for myself *  (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to