rev Posted August 30, 2011 Share Posted August 30, 2011 Hi In something.php (whmcs root) i have <? echo "i love cookies" ?> In header.tpl (templates/default) i have {include_php file="../../something.php"} Now on every page of whmcs i should have "i love cookies" on top but it's not so. Why? p.s. My templates_c is empty 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted August 30, 2011 Share Posted August 30, 2011 Try giving the include_php statement the absolute path to something.php. Not sure about the include _php command. But may require single quotes. Also, probably just an oversight in your example. But requires a ; to end the php line. HTH's -Roger 0 Quote Link to comment Share on other sites More sharing options...
rev Posted August 30, 2011 Author Share Posted August 30, 2011 (edited) Tried the following: {include_php file="/var/www/vhosts/mywebsite.com/subdomains/clientarea/httpdocs/something.php";} {include_php file='/var/www/vhosts/mywebsite.com/subdomains/clientarea/httpdocs/something.php';} With no success Edited August 30, 2011 by rev 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted August 30, 2011 Share Posted August 30, 2011 (edited) Remove the semi-colon from the include_php. Put it the in php statement. Change this - <? echo "i love cookies" ?> to this - <?php echo "i love cookies"; ?> Edited August 30, 2011 by Roger 0 Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted August 30, 2011 Share Posted August 30, 2011 ^ that should place an error in your log if it was the case. I also have never got this to work either. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted August 30, 2011 Share Posted August 30, 2011 Try this: {php} include('/path/to/include.php'); {/php} Worked in every version so far. 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted August 30, 2011 Share Posted August 30, 2011 I have found that as I struggle with Smarty the main problem for me is always the file path. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.