Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / October 2005



Tip: Looking for answers? Try searching our database.

Include into the Index Page.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AnupSaund - 28 Oct 2005 14:57 GMT
I have come from a PHP background - can anyone help me translate this code
snippet into Coldfusion?

                                                                $_GET['page'];
            if(!$page || $page == "index")
                $page = "homepage";
            if(file_exists($page.".php"))
                $include = $page.".php";
            else $include = "error.php";
            include($include);

As you can see - i simply want to be able to do this \?page=whatever. then
that page will be included into the index page.

Thanks.
Dan Bracuk - 28 Oct 2005 15:13 GMT
<cfinclude template="abc.cfm">

Originally posted by: AnupSaund
I have come from a PHP background - can anyone help me translate this code
snippet into Coldfusion?

                                                                $_GET['page'];
            if(!$page || $page == "index")
                $page = "homepage";
            if(file_exists($page.".php"))
                $include = $page.".php";
            else $include = "error.php";
            include($include);

As you can see - i simply want to be able to do this \?page=whatever. then
that page will be included into the index page.

Thanks.
aparsons - 30 Oct 2005 06:47 GMT
to include a page in Coldfusion:

<cfif #CGI.SCRIPT_NAME# EQ 'index.cfm'>

<cfinclude template="path_to_file">
aparsons - 30 Oct 2005 06:48 GMT
to include a page in Coldfusion:

<cfif #CGI.SCRIPT_NAME# EQ 'index.cfm'>
<cfinclude template="path_to_file">
<cfelse>
<cfinclude template="path_to_error">
</cfif>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.