Jump to content

PHP in .tpl files


SRobinson

Recommended Posts

Hi there,

 

Im trying to include my own header in one of the header.tpl files

 

ive tried the code

 

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

and

{php} <? include ("/header.php"); ?> {/php}

 

The first just dosent include the header page, whilst the second breaks it and dosent allow any of the code for the whole page to be displayed!

 

As you can see im trying to include the header.php file which is in the root (public_html) directory

 

Regards,

Scott

Link to comment
Share on other sites

Nope, BAJI26 has it correct. {LITERAL} is for script code and things of that nature. {PHP} should work for an include, and I have it working properly on mine using single quoted like his example. The path should be relative to the root WHMCS install directory.

Link to comment
Share on other sites

{php}

include('header.php');

{/php}

 

Does work, I just tried it. The path is relevant to the WHMCS root.

 

Now, My header.php file is one level up, any ideas on how to go up a level?

 

I tried:

 

{php}

include('./menuheader.php');

{/php}

 

but that (or similar variations) didn't work - is there a special code I need?

Link to comment
Share on other sites

  • 4 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