Changing <title>

Discussion in 'HTML & Website Design' started by Voimis, Nov 24, 2007.

  1. #1
    Hi dudes!

    I use header.php and footer.php on my website so I have <head></head>-information on header.php. My problem is that now the title of website is always same also on different pages.

    What I have to do to get changing title by page?

    Thanks!
     
    Voimis, Nov 24, 2007 IP
  2. Pinup Girl

    Pinup Girl Notable Member

    Messages:
    3,329
    Likes Received:
    214
    Best Answers:
    0
    Trophy Points:
    210
    #2
    if you use the header.php with the information in all pages,i think that there is any way to change it using the same header.php
     
    Pinup Girl, Nov 24, 2007 IP
  3. proprod

    proprod Active Member

    Messages:
    216
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Of course you can do this, you can do anything with PHP. How many pages? And is this a custom script?
     
    proprod, Nov 24, 2007 IP
  4. Voimis

    Voimis Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    There is just about 10 pages!

    I haven´t any script. I just use <?php include("header.php"); ?> in pages and it includes <html><head></head><body> ... etc ... info to every single page!
     
    Voimis, Nov 24, 2007 IP
  5. proprod

    proprod Active Member

    Messages:
    216
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    90
    #5
    Exactly... there is a PHP formula (code) to tell the script what page you're on and generate a title... easy :)

    Post the beginning of your header.php and a couple of sample page urls and I can give you code.
     
    proprod, Nov 24, 2007 IP
  6. junnesss.space

    junnesss.space Guest

    Messages:
    320
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I use PHP includes on all my websites, but I leave the <title> of the page not included in the include. Maybe you can leave the title part out and do it yourself on each individual page?

    Proprod, this is PHP include and has little to do with script unless it is something completely separate.
     
    junnesss.space, Nov 24, 2007 IP
  7. Voimis

    Voimis Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Here´s my header.php:

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <meta name="description" content="Site for finnish Manowarfans - Sivusto suomalaisille Manowarfaneille">
    <meta name="keywords" content="manowar, manowar forum, manowar foorumi, manowar suomi, magic circle festival, magic circle music, battle hymns, into glory ride, hail to england, sign of the hammer, fighting the world, kings of metal, the triumph of steel, louder than hell, warriors of the world, gods of war, joey demaio, karl logan, eric adams, scott columbus, rhino, donny hamzik, david shankle">
    <meta HTTP-EQUIV="Content-Language" content="FI">
    <link href="http://www.manowarfinland.com/tyylit2.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
    <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
    <script type="text/javascript" src="js/lightbox.js"></script>
    <title>Manowar Finland - Suomalainen Manowar fanisivusto</title>
    </head>
    
    <body>
    <div id="a1"></div>
    <div class="a2"><span class="valikko">
    <a href="http://www.manowarfinland.com/">Etusivu</a> 
    <a href="/mfbb">Foorumi</a> 
    <a href="/uutiset.php">Uutiset</a> 
    <a href="/bandi.php">Bändi</a> 
    <a href="/kiertue.php">Kiertue</a> 
    <a href="/kuvat.php">Kuvat</a> 
    <a href="/linkit.php">Linkit</a> 
    <a href="/tekijat.php">Tekijät</a>
    </span></div>
    <div class="a3">
    PHP:
    Pages are from the <div class="a2">, bandi.php, kuvat.php, tekijat.php etc etc.

    Thanks!
     
    Voimis, Nov 24, 2007 IP
  8. butterflymedia

    butterflymedia Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hey, this is how you do it:

    On your regular pages:

    In your header file:

     
    butterflymedia, Nov 24, 2007 IP
  9. Voimis

    Voimis Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks a lot butterflymedia!
     
    Voimis, Nov 25, 2007 IP