SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot jooles's Avatar
    Join Date
    Jun 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Titles On Dynamic Pages

    Ok, so there's the issue of not being able to define a title after the headers have been sent. This is a stick in the mud for me, but I choose to take care of the issue now.

    How do I go about doing this?

    A SAMPLE TITLE:
    MYSITE.com - User View: jooles

    I have a header file that displays the title, and I have it included on each file on my site. So, what I was thinking, was setting a variable $TITLE before including the header file, and have the $TITLE variable echo in between the <title> tags in my header. Or is there a better way to do this. It feels like my method would be messy because I would have to include the header file after a lot of code, and that just bugs me.

    Any input would be appreciated. Thanks.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Most template systems do all the processing before even opening the template file, then do simple string replacement to fill things in.

  3. #3
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I don't see any problems with defining a number of variables, and then insert the include file. Think of it as console programming, where you send the variable to the program before starting the program.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!


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
  •