Results 1 to 3 of 3

Thread: How to implement php code to template

  1. #1
    Jelenik is offline Registered User
    Join Date
    Jun 2009
    Posts
    13

    Default How to implement php code to template

    Hi, i am trying to include random file ads1.html, ads2.html, ads3.html, ads4.html based on random 1-4.

    How can i do this?

    I tried to edit html file and add :

    <?php ?> - -didnt worked (whole source code showed up)
    {php}{/php} -didnt worked (whole source code showed up)
    <%include file="ads{1|rand:4}.html"%> - didnt worked


    Please help me how can i use php in these templates - what i found about smarty - that didnt worked (above).

  2. #2
    maulana's Avatar
    maulana is offline Super Moderator
    Join Date
    Jul 2008
    Posts
    117

    Default

    Hello,

    To execute php code in smarty you need to do something like this :
    PHP Code:
    <%php%>
      echo 
    date("Y/m/d");
    <%/
    php%> 
    Hope this help.

    Thank you.

  3. #3
    Jelenik is offline Registered User
    Join Date
    Jun 2009
    Posts
    13

    Default

    Yes it helps maulana, thanks a lot!

Similar Threads

  1. category php-code!
    By koray in forum v5.x
    Replies: 2
    Last Post: 05-10-2008, 06:30 AM
  2. the code
    By SKh in forum v5.x
    Replies: 0
    Last Post: 06-01-2006, 06:39 AM
  3. Address, Zip Code, etc??
    By RIChristianscom in forum Blocks and Modification
    Replies: 6
    Last Post: 03-27-2006, 11:48 AM
  4. Replies: 5
    Last Post: 06-23-2005, 12:09 AM
  5. Replies: 1
    Last Post: 06-24-2002, 07:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •