I have an index.php file which tells the direction of the pages. So like if its index.php?page=monkey Then it will show the monkey.php page, which would contain Hello this is the monkey page. Picofmonkey.gif, etc. Code (markup): and nothing else. How would I make the index.php know what to put for the page title. Like have the monkey page like define('PAGETITLE', 'The monkey page!'); Hello this is the monkey page. Picofmonkey.gif, etc. Code (markup): But the title tag will obviously be before where it defines it, so I don't know the best way to get this accomplished.
keep the titles list in the php code above your content or before including your content make a choice out of the titles (using switch or if-else) to check the 'page' 's value and then in when the html content begins do something like <head> <title> <?php echo constant("PAGETITLE"); ?> </title> </head> Code (markup): make sure the pagetitle is defined on the basis of conditions only
<?php define("TITLE", "Monkeys page"); ?> <html> <head> <title> <?php print(TITLE); ?> </title> </head> <body> Your content goes here .. </body> </html> PHP: