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>