PHP Includes

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
THiNK

PHP Includes

Post by THiNK »

I am trying to use a PHP include within the template system using standard PHP:

Code: Select all

<?php @include_once($_SERVER["DOCUMENT_ROOT"]."/includedpage.php"); ?>
Thsi doesn't work when added to a template - What do I need to do to ensure this file is included?

Thanks,
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: PHP Includes

Post by calguy1000 »

Check the FAQ in the wiki.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
THiNK

Re: PHP Includes

Post by THiNK »

calguy1000 wrote: Check the FAQ in the wiki.
I have tried this (A1) : http://wiki.cmsmadesimple.org/index.php/Developers_FAQ

However it does not work.

I added a user defined tag, added this code:

Code: Select all

@include_once($_SERVER["DOCUMENT_ROOT"]."/includedpage.php");
, called it 'include' and added {include} to my template but it doesn't work.

I did try

Code: Select all

include"/includedpage.php");
again, this caused an error.

Any ideas?
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: PHP Includes

Post by Elijah Lofgren »

THiNK wrote: I did try

Code: Select all

include"/includedpage.php");
again, this caused an error.

Any ideas?
You're missing a "(" try this:

Code: Select all

include ("/includedpage.php");
Also, maybe you could just paste the contents of includedpage.php into a User Defined Tag if it's not too large.
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
cyberman

Re: PHP Includes

Post by cyberman »

Elijah Lofgren wrote: maybe you could just paste the contents of includedpage.php into a User Defined Tag if it's not too large.
What's the limit ?
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: PHP Includes

Post by Elijah Lofgren »

cyberman wrote:
Elijah Lofgren wrote: maybe you could just paste the contents of includedpage.php into a User Defined Tag if it's not too large.
What's the limit ?
Looks like it's 65kb: http://simon.incutio.com/archive/2002/0 ... TextLimits
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
cyberman

Re: PHP Includes

Post by cyberman »

Thanks  :).
Locked

Return to “Layout and Design (CSS & HTML)”