CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Dynamic Includes From Database Values

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.