help - Alternating title for a website

Discussion in 'HTML & Website Design' started by Millenium, May 25, 2009.

  1. #1
    Hey everyone i'm new to this website, so i hope i'm not asking a repeat question, i've looked around and i can't find it in any case, so here goes nothing:

    I currrentlly have a very simple way of getting a title for my website,

    <title>Title inserted here</title> (duh, eh :p)

    now i've come across a few websites which have a alternating website title each time the page reloads, for example: bungie.net

    Now i've looked long & hard for this, but i can't find a tutorial on how to do it,
    so if someone could post me to one, or create one on the subject, maybe with some source code, it'd be greatlly appreciated.

    Also if possible post the best solution, i'd love that, wheter it's css, html, javascript it doesn't matter. ;)

    Thanks,
    Millenium
     
    Millenium, May 25, 2009 IP
  2. tguillea

    tguillea Active Member

    Messages:
    229
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #2
    Javascript would work but PHP is just so easy for this. Make an array of all the titles you want and then have it randomly output each one.

    example:

    
    $array = ("title 1", "title 2", "title 3", "title 4", "title 5"); //etc
    $num = rand(0,4) //or however many titles you have (less 1 because you start at 0 rather than 1)
    echo '<title>'.$array[$num].'</title>';
    
    PHP:
     
    tguillea, May 25, 2009 IP
  3. sssharlasss

    sssharlasss Peon

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    PHP is definitely the way to go for this, if you can use PHP on your server.

    I would like to point out, though, that changing your website title like that can negatively affect your search engine rankings. Probably not a lot, or anything, but it's just something to consider.
     
    sssharlasss, May 25, 2009 IP
  4. AlexGrim

    AlexGrim Guest

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I agree with the above post. You must remember that your title must closely match your content, otherwise your rank goes downhill.
     
    AlexGrim, May 26, 2009 IP
  5. Millenium

    Millenium Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the example, it works great! :)
    And thanks for the tips also, ill keep that in mind.
     
    Millenium, May 27, 2009 IP
  6. Rogi

    Rogi Active Member

    Messages:
    1,103
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    90
    #6
    Php will be definitely working for it.
    It you are interested in a dynamic title for the website then make it sure that your all the chosen title contains the keywords and matches with the content so that the keyword ranking does not fell down.
    Thanks
     
    Rogi, May 27, 2009 IP
  7. Aaron Sustar

    Aaron Sustar Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I would change only a part of the title and make sure that the most important keywords are always present, preferably at the beginning of your title.

    And yes, PHP is the way to do this - if you change the title using JavaScript, SE Spiders will not even notice that in most cases. I would just change tquillea's code a little bit:

    $array = ("title 1", "title 2", "title 3", "title 4", "title 5");
    echo "<title>Fixed part of your title - " . $array[rand(0, count($array) - 1)] . "</title>";
    PHP:
     
    Aaron Sustar, May 27, 2009 IP