SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Change the <title> Tag in the head afterwards

    Hi,

    I'm using a CMS based originally on PHPNuke (I think it was based on Version 5, but it has been changed a lot...)

    Now the page is parsed part by part, as far as I understand.

    So unfortunately there is a header.php which is parsed fist. It includes the <title>- Tag of the header.

    After that the actual page-content part is produced.

    My problem is now, that I want the title of a download (or whatever) - which is produced by a sql query in the page-content part - to appear in the <title>- tag of the header.

    How could I do this without changing the whole structure?

    When I set a variable in the content part, I can't put it in the header part which is parsed before - or?!

    Fl÷zen

  2. #2
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not very familiar with this, but I think it's possible to cache the output of the script, and then at the very end use a regular expression to look for the title tag and replace everything inside it before sending it to the browser.

  3. #3
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually it's called output buffering. Try this link:
    http://www.phpit.net/article/output-buffer-fun-php/


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
  •