SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast dahmian's Avatar
    Join Date
    Nov 2003
    Location
    san diego
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question auto_prepend_file.inc and <title>

    I am having trouble figuring out a way to use auto_prepend while still being able to change the title of a page. There has to be some terribly clever way to do this without having to write split the title tag

    What I would like the auto_prepend to be:
    PHP Code:
    echo '<html>';
    echo 
    '<head>';
    echo 
    '<title>';
    echo 
    'DynamicTitleGoesHereSomeHow';
    echo 
    '</title>';
    echo 
    '</head>';
    echo 
    '<body>'
    What works but is not very elegant:

    auto_prepend
    PHP Code:
    echo '<html>';
    echo 
    '<head>';
    echo 
    '<title>'
    a regular file
    HTML Code:
    DynamicTitleGoesHereSomeHow
    </title>
    </head>
    <body>
    ...

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should have your script do its processing and logic before it starts to construct html markup. This way the script knows what its going to output, before it outputs it. You wouldn't use auto_prepend_file in such a case, if you intend to place html in it.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •