CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Dynamically selecting a include page

Print topic Send  topic

Author Message
materix
Posted: 03/13/2005, 11:13 AM

Hi.
I am using CCS, PHP and mysql.
I have created one standard page (index.php) with a header, body and footer. Then I have created many different content-pages that are includable.
My plan is to include a content-page in the body-area of the standard-page decided by a url-parameter.

E.g. index.php?page=1 then include content-page_1
index.php?page=2 then include content-page_2

How do I achieve this?
RonB

Posts: 228
Posted: 03/14/2005, 3:00 AM

Modify the index.php code page directly in the white area underneath the other include statements:

if (CCGetParam("page",'')=1)
{
include(RelativePath . "/first_include_page.php");
}elsif (CCGetParam("page",'')=2)
{
include(RelativePath . "/second_include_page.php");
}

etc etc. Using case would be more elegant.

Ron
View profile  Send private message
materix
Posted: 03/14/2005, 8:57 AM

Hi Ron. Thx for your reply.

Quote :
Modify the index.php code page directly in the white area underneath the other include statements:

Does not this mess up the automatic code-generation in ccs? Should not all written code be placed in the events-file? Or is ok to write code directly in the generated page?
peterr


Posts: 5971
Posted: 03/14/2005, 10:37 AM

metrix,
You can add new code in the generated page if you place it within the white code area, usually near the beginning of the page. We recommend leaving the grey code blocks unmodified.

Alternatively, you can include several pages next to each other, then hide the ones that you don't need in the Before Show event of the page.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
materix
Posted: 03/15/2005, 2:20 AM

Peterr, thx for the reply.

Quote :
Alternatively, you can include several pages next to each other, then hide the ones that you don't need in the Before Show event of the page.

If I include several (large) pages and then hide all pages except a single page - will all pages be loaded or only the one that is visible?
peterr


Posts: 5971
Posted: 03/15/2005, 11:08 AM

I think so, because we don't know what those pages are doing (they may be sending emails for example).
However, you may be able to implement some simple logic in those includable pages that would prevent them from executing, though I don't have specific examples available.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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