1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Random Title Tags

Discussion in 'Content Management' started by donteatchicken, Apr 11, 2006.

  1. #1
    Some out of the box php sites leave you with little title tag options, so I found a better way.. :D

    If you can make a simple mysql database of titles use this code to display them randomly, even on refresh!

    (assuming you already have a connection established to the db)

    $results = mysql_query('SELECT Name from tb_titles  ORDER BY RAND() LIMIT 1');
    while ($row = mysql_fetch_object($results)) {
       $titles = $row->Name;
       }
    mysql_free_result($results);
    PHP:
    Also in your header page code do something like:

    print "<title>All about $titles</title>";
    PHP:
    ;)
     
    donteatchicken, Apr 11, 2006 IP
  2. Old Welsh Guy

    Old Welsh Guy Notable Member

    Messages:
    2,699
    Likes Received:
    291
    Best Answers:
    0
    Trophy Points:
    205
    #2
    Rotating your title tags is lunacy IMO. The title tag together with backlink anchor text are the two strongest elements of SEO. Why screw them over?
     
    Old Welsh Guy, Apr 11, 2006 IP
  3. donteatchicken

    donteatchicken Well-Known Member

    Messages:
    432
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    118
    #3
    Never came to mind, In that case use:

    order by ID limit 1
    PHP:
    in the sql query, that way they will not be random and you can still easily add "static" titles.
     
    donteatchicken, Apr 11, 2006 IP
  4. Old Welsh Guy

    Old Welsh Guy Notable Member

    Messages:
    2,699
    Likes Received:
    291
    Best Answers:
    0
    Trophy Points:
    205
    #4
    Much better. In theory then you can add a title for each page, number that page and control title dynamically.
     
    Old Welsh Guy, Apr 11, 2006 IP