PHP and smarty include help needed

Discussion in 'PHP' started by mgrohan, Sep 7, 2007.

  1. #1
    Trying to get a php include to work properly in a tpl file (smarty), with no luck.

    I want to duplicate a url with variable like this one
    {$my_pligg_base}/play.php?id={$link_id}
    (this is working fine)

    Now i am trying to do something like:

    {php}include file='http://www.mysite.com/thumb.php?id={$link_id}'{/php}

    The include works, but i can't get the variable to show correctly inside the smarty php tags.


    Any advice would be greatly appreciated.
     
    mgrohan, Sep 7, 2007 IP
  2. kreoton

    kreoton Peon

    Messages:
    229
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i don't think that you must variable throw smarty try define a variable in working php. next in tpl file try to use code like this:

    {PHP}include 'http://www.mysite.com/thumb.php?id='.$your_variable;{/PHP}
    PHP:
    I'm not tested this but i think this should work ;)
     
    kreoton, Sep 7, 2007 IP
  3. mgrohan

    mgrohan Active Member

    Messages:
    671
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    58
    #3
    mgrohan, Sep 7, 2007 IP