jjrjr1
Posts: 942
|
| Posted: 07/02/2008, 8:42 AM |
|
Hi
Does anyone know if there is a way to dynamically load include files based on a database value.
For example, I would like to have a field in the database to be 'include.php' and the CCS script will load that include at a specific location on the page where the include page control is.
Thus when the database is changed to a different include filename the new include file is inserted.
Thanks
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
mentecky
Posts: 321
|
| Posted: 07/02/2008, 9:24 AM |
|
Hey John,
Include with a variable expression is totally valid in PHP. So, you can lookup your filename and use:
include($filename);
Rick
_________________
http://www.ccselite.com |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/02/2008, 9:33 AM |
|
Rick
Thanks.
But how will that work in CCS.
I need to do a database lookup to get the filename. Then have the file put into an include control in CCS so all the events will bind... etc.
Would not that be a little late in the code to dynamically add an include?
Would this be a page level on cache event?
What do you think?
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
mentecky
Posts: 321
|
| Posted: 07/02/2008, 9:42 AM |
|
John,
Try putting it in the page in any white space outside of the functions. For example under the includes in the filename_events.php file. If you enter code in the white space it will execute on load and make the include global.
Rick
_________________
http://www.ccselite.com |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/03/2008, 8:14 AM |
|
Rick
I was sort of thinking about trying something like that.
TO get it positioned at the right place on the page do you think I should actually insert a CCS include page control (ALthough this would create hard coded binds in the main page) or do something like your elegant ob thing inside a label control positioned where I want it?
Thanks for your input.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
mentecky
Posts: 321
|
| Posted: 07/03/2008, 12:14 PM |
|
John,
Maybe an old thread we worked on can solve your problem:
http://forums.yessoftware.com/posts.php?post_id=97665&s_keyword=ob_start
Rick
_________________
http://www.ccselite.com |
 |
 |