Do not remember me!
/ / / How to add php code to run in main.tpl?

How to add php code to run in main.tpl?

How to add php code to run in main.tpl?
I want to install an ads which required a php code after
Plz help! Added by: in PHP Questions on


+1

Comments 5

  1. dlefaq
    0
    dlefaq Currently Offline → 6 August 2015 23:34

    place your code in php extension and place it in your site root or any specific folder then use include file in main.tpl, for example save your php code in ads.php and upload it to your site root then open main.tpl use include tag like this
    {include file="/ads.php"}
     2 |  102
    1. freshwap
      0
      freshwap Currently Offline → 7 August 2015 02:02

      the include tag can be put anywhere? bcos i tried this solution but seem not work...
       6 |  11
      1. yorismith
        0
        yorismith Currently Offline → 9 August 2015 09:10

        it will 100% working and I have done in many of website, unless you copy and paste php code in ads manager in admin cp other than it will absolutely working
         N/A |  45
  2. wapmastera
    0
    wapmastera Currently Offline → 7 August 2015 06:45

    open engine/modules/main.php and find:
    echo $tpl->result['main'];

    replace with:
    eval (' ?' . '>' . $tpl->result['main'] . '<' . '?php ');
     3 |  7
  3. yorismith
    0
    yorismith Currently Offline → 9 August 2015 09:14

    wapmastera, thank you, but there is security hole issue with this hack and many developers are talking about it on dle-news.ru forum http://dle-news.ru/tips/33-ispolzovanie_ljubykh_php_vstavok_v_shablonakh.html and dle-faq.ru, however, the hack will work, thank you
     N/A |  45

Information

Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.