Creating Dynamic Title Tags for Website Search

Discussion in 'PHP' started by rakers8, Oct 14, 2009.

  1. #1
    Disclaimer: I'm not a programmer. However I do work with a programmer once a week so I'm trying to get enough information as possible to see I can achieve the following:

    I work with a company that has a dynamic site and many different categories. For each category we have a landing page. From that, you can use a search box to reach the listings. I would like to know how to echo 'search keywords' into the title tags of the search results.

    This might not be clear so I'll offer examples with our site.

    Landing Page:
    http://www.rentittoday.com/vacation_rental.php

    Scroll to the bottom of the page and click on 'ALABAMA'.

    This brings us to the results page:
    http://www.rentittoday.com/viewers/vacation_rentals_results.php?state=AL

    For now we have a generic title tag for the results page regardless of what is searched for. I would like for the title tag to read the '?state=AL' in the url and convert that to 'Alabama Vacation Rentals' in the TITLE.

    Am I thinking about this the correct way?
    Thanks
     
    rakers8, Oct 14, 2009 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Unless you can reference a table or some data that has key values of the search queries, you won't be able to do this
     
    JAY6390, Oct 14, 2009 IP
  3. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It would be more helpful if you gave links to OTHER websites as well Gungz, since you just post that link every chance you get
     
    JAY6390, Oct 15, 2009 IP
  4. jnelson563

    jnelson563 Peon

    Messages:
    72
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if you want to hard code every single states title tags you could do this

    
    <?
      switch($_REQUEST['state']){
        case "AL":?>
         <title>Alabama title tags</title>
    <? break;
      } ?>
    
    
    PHP:
     
    jnelson563, Oct 15, 2009 IP