Thread: PHP Titles?
View Single Post
Old 02-18-2013, 02:19 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Did you put it between your <title> elements?
You can do this of course. It simply means restructuring so your processing ends up before your HTML output. Ultimately this is what you should do in PHP anyways.
A really simple example:
PHP Code:
<?php

// Do whatever to get these records.  I'll just pretend that I have a function for it.
$record fetchMaRecord($_GET['id']);
// now $record has what it need, and presumably only one result.
?>
<Doctype. . .>
<html>
    <head>
        <title><?php echo $record['name'];?></title>
    </head>
    <body>
....
Simple as that. Just make sure that you don't output the head and title until after you've retrieved your results.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote