Defining <title>
Posted: Sat Apr 21, 2007 10:14 pm
feyd | Please use
And on the header.php...
But it always seems to display "Site Title Not Set", rather than the title I've defined within the page.
Any idea what I could be doing wrong? I'm very much a beginner when it comes to php, so don't laugh if my code is terribly stupid
Thanks in advance
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm trying to make part of my title custom, defined on each page of my site, with the other part displayed on every page.
So it will look like...
[b]Specific Page Title | Domain.com[/b]
but I can't seem to get it to work. Here is my current code on the main page...Code: Select all
<?php
define ('TITLE', 'Page Title Here');
//requre the header file
require('http://domain/includes/header.php');
include('http://domain.com');
?>Code: Select all
<title><?php if (defined ('TITLE')) {
print TITLE;
} else {
print 'Site Title Not Set.';
}
?></title>Any idea what I could be doing wrong? I'm very much a beginner when it comes to php, so don't laugh if my code is terribly stupid
Thanks in advance
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]