include() doing weird things (NEWBIE!)
| From: | David G. Simmons | Date: | Fri, 23 May 2003 16:30:31 +0000 |
| Subject: | include() doing weird things (NEWBIE!) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-148795@lists.php.net to get a copy of this message | ||
Okay, I admit I'm a newbie, but include is doing weird things to me.
<?php
include("headfoot.inc");
$title="My Title";
mk_header($title);
...
my other php stuff
...
mk_footer();
?>
One would think that this would place the header first, then my
specific php stuff, then add the footer to the BOTTOM of the page, but
that is not what's happening!
I get the title set correctly, then the footer is displayed, then the
stuff from my php processing.
So the footer ends up at the TOP of the page!
headfoot.inc contains:
<?php
function mk_header($title){
printf("<html>");
printf("<head>\n");
printf("<title>PHP: $title</title></head>\n");
printf("<body bgcolor=\"white\"
background=\"notebook2a.gif\">\n");
}
function mk_footer(){
$dt=date("D F jS, Y (h:i a T)");
printf("This page created dynamically: $date"\n");
printf("</body>\n</html>\n");
}
If anyone can point out my boneheadedness here I would greatly
appreciate it! I'd love to have the footer at the bottom of the page!
Replies direct, if possible, as I am on digest-only.
TIA,
dg
--
David G. Simmons
The Calvinator(TM) says:
"They drink water all day just in case someone picks them up."
-Hobbes