Dynamic Page Titles With PHP

Discussion in 'PHP' started by fordP, Jul 18, 2006.

  1. #1
    I have a directoroy and i want to make the page titles dynamic. There is already
    $mainframe->setPageTitle( _DIRE_TITLE );[CODE]
    
    I want it to put &catid into the setPageTitle but I don't know how to call up &catid or seperate the two. I tried putting the variable &catid into there and seperating them with a space like this "( &catid, _DIRE_TITLE )" but it didnt work 
    
    :confused: :confused: 
    yes im a noob :D
    Code (markup):

     
    fordP, Jul 18, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What directory script are you running? Whoever made it should be able to help. It is hard to help as your site is using a special class which may need altering.
     
    mad4, Jul 19, 2006 IP
  3. fordP

    fordP Peon

    Messages:
    548
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The cms is Joomla!. I forgot to ask on there forums ill do that now
     
    fordP, Jul 19, 2006 IP
  4. petronel

    petronel Peon

    Messages:
    113
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    &catid is a variable from URL ?
    you can probably do something like:
    $mainframe->setPageTitle( $_GET["catid"] ." - " . _DIRE_TITLE );
    Code (markup):
    or
    $mainframe->setPageTitle( $catid ." - " . _DIRE_TITLE );
    Code (markup):
     
    petronel, Jul 20, 2006 IP
  5. Sonu2007

    Sonu2007 Banned

    Messages:
    467
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it's usefull man
    thx
     
    Sonu2007, Jul 20, 2006 IP
  6. coderlinks

    coderlinks Peon

    Messages:
    282
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Make sure you filter that data you get from catid using htmlspecialchars and addslashes functions. Or you will have XSS vulnerabilities in your site.

    Thomas
     
    coderlinks, Jul 21, 2006 IP
  7. fordP

    fordP Peon

    Messages:
    548
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #7
    wow thanks for the responses, it took me a little while but I was finally able to do it!
     
    fordP, Jul 23, 2006 IP