How to dynamically set the Title

Discussion in 'PHP' started by kks_krishna, Jul 7, 2007.

  1. #1
    HI,

    I am using the following script to set the title tag:

    <title><?php echo($title); ?></title>

    Is there any problem in this?

    Title tag is not set to the value.
     
    kks_krishna, Jul 7, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    What's the title you're getting with that code ?
     
    ajsa52, Jul 7, 2007 IP
  3. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #3
    I am getting the String value
     
    kks_krishna, Jul 7, 2007 IP
  4. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #4
    <?php
    $title = $_GET['title'];
    echo "<title>" . $title . "</title>";
    ?>
     
    crazyryan, Jul 7, 2007 IP
  5. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #5
    Thanks.
    Its working. I have done mistake in retriving the title string.
     
    kks_krishna, Jul 7, 2007 IP