, Guest!
Already a Member? Login or Register.

Menu



Showcase


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 
Wolf




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!
 
otter
Administrator



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

An include goes like this:


Code

include_once('scriptlocation');


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:


Code

?> your text here <?

include_once('scriptlocation');



Otter and Out!


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




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)?

Thanks,
Wolf
 
Wolf




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?

Thanks!
Wolf
 
DCSun
Administrator



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

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.


David


FlexCMS v3.2 Has Been Released!
 

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




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!

MEMBERS




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

Processing Time: 0.08049 seconds.
 
Management Login

Powered By FlexCMS
Powered By FlexCMS