|
Posted by guitarromantic on 02/18/06 18:41
Hey everyone.
I'm editing some stuff I did last summer, trying to bugfix and improve
stuff. One improvement (or an oversight of the original design) is
adding dynamic <title> tags to my pages. Here's how I originally
structured my php pages:
include header.php (contents are basically my HTML/CSS up to the
<!--begin content--> point)
<php code>
include footer.php (contents are from <!--end content--> onwards).
Obviously this meant I had the same <title> as defined in header.php
for every page, not cool. I went through and revised the structure to
this:
include doctype.php (HTML from the opening document declaration down to
just before <title>)
Then began my query(s), and once the results were grabbed:
echo "<title>$bandName - recordName review</title";
include header.php (this file now contains everything below <title>
down to <!--begin content-->)
<php code to output content>
include footer.php (as above)
This worked great for almost all of my pages but one. Here's the link:
http://www.threechords.org/spb/reviews/678
This might look normal to you, but try clicking some of the other
reviews in the left panel. The cover image and headings stay the same,
and the author information at the bottom again stays the same, which is
of course incorrect. I'm not sure where I'm going wrong with my code,
so I'll post up what I'm doing:
http://www.threechords.org/spb/reviews/displayreview.phps
That file has doctype.php, header.php and footer.php physically
included so you can see their contents too (ordinarily they're included
with php includes).
Any advice as to why I can't get this to work/ how terrible my code
structuring is would be really helpful.
Matt
[Back to original message]
|