




FlexCMS eNews 
To subscribe to our enewsletter, please enter your email address in the box below and click the "Subscribe" button.
Note: You may easily remove yourself from the newsletter list at any time by following the instructions included with every mailing.  |
|
|  |

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 |
|
|
| 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: 159 |
|
|
| 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! |
|
|
|
|
|
|
| |
|
|
| Page location | November 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 |
|
|
|
|
|
|
| |
|
|
| Conruzuled | November 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: 421 |
|
|
| 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 |
|
|
|
Last Edit: November 21, 2007 @ 2:32pm by DCSun | |
|
|
|
| |
|
|
| Thank you | November 21, 2007 @ 3:13pm | | Thanks David! |
|
|
|
|
|
|
|

|
|
|