Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
jeby #1
GetTemplatePath()
Is there an alternative to GetTemplatePath() so that I can return the URL
instead of the absolute path from the server?
I want
[url]http://home.constps.org/index.cfm[/url]
not
c:\cfusionmx7\wwwroot\home.constps.org\index.cfm
I am having trouble using the absolute path for some reason.
All suggestions are appreciated!
Thanks all!
Josh
jeby Guest
-
jrunrandy #2
Re: GetTemplatePath()
I think that you might be able to use one of the CGI variables. Try doing a cfdump on the CGI scope and see if one of those values will meet your needs.
jrunrandy Guest
-
MattRobertson #3
Re: GetTemplatePath()
You can use the following code to completely rebuild a url and its query
string. It will even account for server port so if you are using the dev
version of CF it will still work.
Hope this Helps,
--Matt--
MSB Web Systems... [url]http://mysecretbase.com[/url]
"We are all in the gutter, but some of us are looking at the stars."
- Oscar Wilde
<cfif Len(Trim(cgi.query_string)) gt 0>
<cfset variables.QueryDelim="?">
<cfelse>
<cfset variables.QueryDelim="">
</cfif>
<cfif not CompareNoCase(cgi.https,"ON")>
<cfset variables.HTTPData="https://">
<cfelse>
<cfset variables.HTTPData="http://">
</cfif>
<cfif not Compare(cgi.server_port,"80")>
<cfset variables.ServerPort="">
<cfelse>
<cfset variables.ServerPort=":"&cgi.server_port>
</cfif>
<cfset variables.CurrPage=variables.HTTPData &
cgi.server_name & variables.ServerPort &
cgi.script_name & variables.QueryDelim &
cgi.query_string>
MattRobertson Guest



Reply With Quote

