[thelist] Finding the URL of the page in ColdFusion

jeff jeff at members.evolt.org
Tue Apr 3 19:58:30 CDT 2001


faust,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Faust at ThinkChurch.com
:
: How do you find the URL of the page
: currently being displayed by the browser?
: I want to know so I can get rid of any
: links to the page the user is currently
: viewing.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

there are multiple parts to a url:

the protocol available via #cgi.https#:

http:// - off
https:// - on

the host available via #cgi.http_host#:

www.domain.com

the path to the currently requested coldfusion document via
#cgi.script_name#:

/cars/about/index.cfm

and the querystring via #cgi.query_string#:

foo=bar&foo_id=7&cfid=342156&cftoken=1351098374

how you code the site will determine which of these you need to take into
consideration.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: Also, usually I would only wrap the second
: #dynamically_generated_link# in CFOUTPUT
: tags, but I chose readbility over performance
: for this e-mail.  :-)
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

fwiw, there's no appreciable performance gain (hardly even measurable except
on the biggest of sites) by using lots of <cfoutput> calls around variables
as opposed to wrapping large blocks of cf/html with a single <cfoutput>.
however, there *is* an appreciable readability gain by using the method of
large blocks wrapped in <cfoutput>

good luck,

.jeff

name://jeff.howden
game://web.development
http://www.evolt.org/
mailto:jeff at members.evolt.org





More information about the thelist mailing list