Custom Page Title - Possible?

Discussion in 'Programming' started by KentMayne, Feb 6, 2007.

  1. #1
    Hi, is it possible for the user to input a custom page title into a text field, press submit and for the current page they're on to change it's title?

    So, say I enter 'Google Seach - Results' into the field, that would then make the page title the same as the one I inputted?

    (By title, I mean the <title></title> tags)

    Possible? Thanks.
     
    KentMayne, Feb 6, 2007 IP
  2. Shorin

    Shorin Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you are using PHP, you could use a POST or a GET and echo the variable in the title tag.

    <? $title=$_GET['formfield']; ?>

    <title><? echo $title; ?></title>

    or use POST.

    Is that what you want?
     
    Shorin, Feb 6, 2007 IP
  3. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #3
    
    <html>
    <head>
    <title>Title</title>
    </head>
    <body>
    <input type="text" id="newTitle" onkeyup="return document.title = newTitle.value"/>
    </body>
    </html>
    
    HTML:
    
    <html>
    <head>
    <title>Title</title>
    </head>
    <body>
    <input type="text" id="newTitle"/>
    <input type="button" 
           onclick="return document.title = newTitle.value" 
           value="Change Title" />
    </body>
    </html>
    
    HTML:

    NJoy ....
     
    krakjoe, Feb 6, 2007 IP
  4. KentMayne

    KentMayne Peon

    Messages:
    86
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Okay thanks guys, really appreciate it!
     
    KentMayne, Feb 6, 2007 IP