how to make php work in tpl

Discussion in 'PHP' started by David Holland, Dec 11, 2010.

  1. #1
    when i put the code in below to a tpl file an error shows on the webpage

    how do i make this work in the tpl, thank you

    <?php include_once("test.php"); echo "<div>$bannerAd</div>"; ?>
     
    David Holland, Dec 11, 2010 IP
  2. kind_of_the_cash

    kind_of_the_cash Active Member

    Messages:
    852
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    85
    #2
    You may try

    <?php include_once("test.php"); echo "<div>".$bannerAd."</div>"; ?>
     
    kind_of_the_cash, Dec 11, 2010 IP
  3. David Holland

    David Holland Active Member

    Messages:
    155
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    90
    #3
    when i do this i get this on the page and no ad

    ".$bannerAd."
    "; ?>
     
    David Holland, Dec 11, 2010 IP
  4. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #4
    which templating engine are you using? I would start by looking at the docs for that engine.
     
    shallowink, Dec 11, 2010 IP