IF Condition Not Showing Right Result...
Posted on 2012-09-10
Im trying to checking if “ query_string” is not coming or if it is NULL AND template is NOT “Index.cfm ” forward to ERROR.CFM Page
Im doing to prevent error if someone remove IDs or remove query string
When im writing this code my index.cfm page is also not coming it going on error.cfm page other then this everything working fine.
Here is my index.cfm code.
<cfset currTempl = trim(GetFileFromPath(GetCurrentTemplatePath()))>
Here im checking current template name .
<cfparam name="indexTemp" default="False" type="boolean">
<cfparam name="currTempl" type="string" default="">
<cfif trim(currTempl) EQ "INDEX.CFM" OR trim(currTempl) EQ "index.cfm" >
<cfset indexTemp = True >
<cfif len(trim(QUERY_STRING)) IS 0 AND indexTemp NEQ True >
<cflocation url="error.cfm" addtoken="yes">
If there is any easy way please let me know, really appreciated