Jump to content

integrating php include


hyptonic

Recommended Posts

So I searched around the forums and found many answers but none that solved my problem.

 

I'm trying to include my outside php header and footer file in the header.tpl and footer.tpl

 

iv tried many things but none seem to get my file included in the site. iv also tryed full paths.

{php} include("site_header.php"); {/php}

{include_php file="site_footer.php"}

 

 

http://hyptonic.net/ampedhosts.com/clients/

^^where my whmcs is found

 

 

if anyone has any ideas that is greatly appreciated

Link to comment
Share on other sites

{php}

The {php} tags allow PHP code to be embedded directly into the template. They will not be escaped, regardless of the $php_handling setting. This is for advanced users only, not normally needed and not recommended.

 

Technical Note: To access PHP variables in {php} blocks you will need to use the PHP global keyword.

 

Example 7-28. php code within {php} tags

 

{php}

// including a php script directly from the template.

include('/path/to/display_weather.php');

{/php}

 

 

Example 7-29. {php} tags with global and assigning a variable

 

{* this template includes a {php} block that assign's the variable $varX *}

{php}

global $foo, $bar;

if($foo == $bar){

echo 'This will be sent to browser';

}

// assign a variable to Smarty

$this->assign('varX','Toffee');

{/php}

{* output the variable *}

<strong>{$varX}</strong> is my fav ice cream :-)

Link to comment
Share on other sites

After realizing debugging was turned off and I added $display_errors="on"; to configuration file. I ended up finding that the include was calling my external file from the template_c folder. everything is good now.

 

Thanks for those of you who helped.

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated