Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Location
    USA
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question php include in a template file

    I want to insert a php include inside my template file, however, like most servers, my server will not employ that function since it could only work with the files with a .php extention.

    Is there a way around this?

    If not, what can be an alternative to insert an include function in a template?

    Thanks.

  • #2
    New Coder
    Join Date
    Jul 2005
    Location
    Perth, Australia. Age: 13
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could use .htaccess to make it so that files with that extension is treated like a php file.
    Code:
    AddHandler application/x-httpd-php .ext
    Just change .ext to the extension.
    I lost my signature, have you seen it?
    I have the power to erase you...

  • #3
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You should first check that your server dont mind you doing this.. While they *shouldnt* have any problem with it, I have heard of accounts being de-activated due to people setting up things in .htaccess that the server didnt want to allow (SSI for example). Besides, it cant hurt asking and if theyre anything of a decent host they will say yes

  • #4
    New Coder
    Join Date
    Apr 2005
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could change the extension of the template file to .php


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •