, Guest!
Already a Member? Login or Register.



Due to the volume of spam happening on our forums, posting is now restricted to verified members only.  If you're not verified, drop us a note with your username.

Home > FlexCMS Support Forum > User Help > General Support Requests > Script Include Syntax

FlexCMS Support Forum

Script Include Syntax
Started November 20, 2007 @ 5:39pm by Wolf
Post Message 

Posts: 65
Syntax when "including"November 20, 2007 @ 5:39pm
What's the sytax for using it as an "include" on a page?

Thank you!

Posts: 177
November 20, 2007 @ 6:10pm
Hey Wolf,

An include goes like this:



Make sure you check the Enable PHP box as well.

If you want to add text above or below that include, simply use the following:


?> your text here <?


Otter and Out!

ONLINE TRAINING CLASSES FOR FLEXCMS IN MAY: FlexCMS Basics (101), Sat., May, 15, 2010 & FlexCMS Blocks (Mon., May 10, 2010).

Posts: 65
Page locationNovember 20, 2007 @ 8:53pm
Hi Otter,

Thanks for the speedy reply. When I create a page in Flex, to use as an include page... is the page location the root directory (i.e. public_html)?


Posts: 65
ConruzuledNovember 20, 2007 @ 11:41pm
Hey Otter,

I think I'm confused and maybe misinterpreting the original directions.

When it was said, "save this snippet as its own file and then use a php include statement" I saved the code as a Flex page, not a regular filesystem file.

My include statement can't seem to find the flex page (and using cpanel, I can't locate it either - so I'm thinking it's in the database, right?)

If it is in the database, can I include it from there?


Posts: 625
November 21, 2007 @ 2:28pm

There isn't any easy way to access a FlexCMS page from within another page. And yes, they're stored in the database -- the core-Pages table to be exact.

If you really wanted to do it that way, you could add "exit();" at the bottom of the page you're including (which will stop the blocks and template from being added to it), and then include it with the full url -- "include_once('http://www.yoursite.com/index.php/pages/pagename');".

Ideally you'd create a .php file in or below your "public_html" folder, and then include it in a page that way. I like to make a "scripts" folder to keep them all organized, and then the syntax becomes "include_once('./scripts/yourscript.php');"

And you could also just paste that block of code directly into the page you want it to appear in.


FlexCMS v3.2 Has Been Released!

Last Edit: November 21, 2007 @ 2:32pm by DCSun

Posts: 65
Thank youNovember 21, 2007 @ 3:13pm
Thanks David!

Post Message 

Try & Buy FeedForAll - Easy to use RSS Feed Creator - great for iTunes users!


All Contents, Code, Scripts and Technologies Copyright 2003-2009 FlexCMS.
All Rights Reserved. Software License Agreement

Processing Time: 0.07892 seconds.
Management Login

Powered By FlexCMS
Powered By FlexCMS