Hi Could any one help me to Embed this Code

Discussion in 'PHP' started by DewShare, Aug 27, 2009.

  1. #1
    Hi

    I want to embed "linkex" in main.tpl file of my template. It is the code which needs to embed there

    <?php include( "linkex/data/output/1001" ); ?>
    Code (markup):
    It once succeed in putting Php code in main.tpl. But it does not produce the out put which is in data file /1001/.

    Please help me for this I shall be thank full to you
     
    DewShare, Aug 27, 2009 IP
  2. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #2
    Put full path , you can also try include_once ,etc .
     
    it career, Aug 27, 2009 IP
  3. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    tpl files (smarty template) cannot execute PHP code within the file unless you wrap it with {PHP} ... {/PHP} (as opposed to <? ... ?>), also the include would be relative to the smarty loader in this case and not the template file.
     
    kblessinggr, Aug 27, 2009 IP
  4. DewShare

    DewShare Well-Known Member

    Messages:
    426
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    135
    Digital Goods:
    1
    #4
    thanks I do the same I succeed. This php code is included but the file does not show the output.

    in simple php page it shows output data.
     
    DewShare, Aug 27, 2009 IP