![]() |
using php include in tpl
Is it possible to use a php include statement in a tpl to insert a html table already created elsewhere in my site? I couldn't get it to work if it is in fact possible.
|
Re: using php include in tpl
Use
Code:
{php} ... {/php} But omit the <? and ?> OR http://smarty.php.net/manual/en/language.function.include.php.php |
Re: using php include in tpl
Thanks. I tried this to bring in a table into head.tpl but didn't work:
{php} include ('http://www.qualityfoodproducts.com/menu.php'); {/php} Can you tell what's wrong with it? |
Re: using php include in tpl
Try the other method...
Code:
{include_php file='http://www.qualityfoodproducts.com/menu.php'} |
Re: using php include in tpl
Also make sure that allow-url-fopen PHP option is enabled.
|
Re: using php include in tpl
why are you referring to a url? (assuming the php resides on your own server)
it will cause a dns lookup slowing down the load time just do an " include 'menu.php'; " you may need to add "../" before the menu.php since you are calling it from a template, but i dont remember exactly |
Re: using php include in tpl
I still can't get the php include to work and have to move on now. I'll just rebuild the menu in head.tpl. Cheers thanks for you help though.
|
Re: using php include in tpl
I too have tried everything suggested in this topic and have had no luck. Anymore ideas?
|
All times are GMT -8. The time now is 01:47 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.