NEED / WTH: Programmer for quick job $$

Discussion in 'Programming' started by PPCJohn, May 18, 2009.

  1. #1
    I need a "fix" done to a script that I am using.

    Currently, this is how it works... you put a term into the "term" variable in the URL and pulls that terms and posts it to the page. Example -> mysite.com/index.php?term=bananas

    On the page, it will then say "Looking for bananas?" which it currently does. However, I need something setup so if there is nothing put in the "term" it displays a default value of "items."

    The problem is I have a tml file that is pulling this data and posting it to the php page. so the data is in index.tml, but the page is posted at index.php. Meanwhile, the "get" function resides in the php file itself, but I can not get it to display a default text. Here is the code:

    $tpl->set('thisterm', $_GET["term"]);
    Code (markup):
    If you want to take the job, hit me up with your price in a PM. I can pay paypal or epass
     
    PPCJohn, May 18, 2009 IP
  2. ngcoders

    ngcoders Active Member

    Messages:
    206
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Why not

    $term = (isset($_GET['term']) && !empty($_GET['term']))?$GET['term']:'default';

    $tpl->set('thisterm', $term );
     
    ngcoders, May 18, 2009 IP
  3. dotcomguy

    dotcomguy Peon

    Messages:
    824
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    dotcomguy, May 18, 2009 IP