Displaying URL by concatenating CGI variables
Good morning,
I have been trying to display the url of the website I am working on.
I wanted to declare the url as a CGI variable:
For example:
<cfset url ='http://' & #CGI.SERVER_NAME# & #CGI.SERVER_PORT# & #CGI.SCRIPT_NAME#>
And then call the variable "url" to display the url of the page.
For example:
<cfoutput>This URL is : #url#</cfoutput><p>
My code does not seem to work. This is the error message I am receiving:
I know I can use this code:
<cfoutput>URL of this template: http://#CGI.SERVER_NAME#:#CGI.SERVER_PORT##CGI.SCRIPT_NAME#</cfoutput><p>
However, I want to be able to better manage my code by keeping with the other variables. And I am little apprehensive on using HTTP_REFERER because it is not display anything on the page. The problem is due to some browser restrictions. Therefore, I would rather use something else that I can guarantee will display regardless of the browser being used by the user.
Does anyone have any ideas how to properly concatenate the CGI variables so I can used it to initialize the url variable?
Thanks for the help!!!
