Skip to main content
Inspiring
December 2, 2008
Question

Capture full URL with CF CGI variable

  • December 2, 2008
  • 4 replies
  • 6019 views
I need to capture an entire URL and send it in the body of an email, using CFMAIL. I'm looking at my CGI variables using CFDUMP, but can't seem to get the entire URL string, including the http:// or https://. Help?
    This topic has been closed for replies.

    4 replies

    ssailerAuthor
    Inspiring
    December 2, 2008
    Azadi - your method worked excellently, too! Thanks to both of you!
    Participant
    August 3, 2013

    Both methods worked for me to on CFML8 setup.  However, I need the #bookmark value and both attempts above do no include the bookmark  information.  Does anybody have a clue on how to preserve bookmark information from the URL line?  Thanks in advance.

    Inspiring
    August 3, 2013

    That part of the URL is intended for the browser, and is not relevant to the server so is not transmitted with the request, so it never gets to the web server, let alone the CF server.

    If you need that info, you're gonna need to send it some other way.

    --

    Adam

    ssailerAuthor
    Inspiring
    December 2, 2008
    Daverms, this UDF worked perfectly.
    Inspiring
    December 2, 2008
    <cfoutput>http<cfif cgi.https is "on">s</cfif>://#cgi.server_name &
    cgi.script_name#<cfif
    len(trim(cgi.query_string))>?#cgi.query_string#</cfif></cfoutput>

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Inspiring
    December 2, 2008
    Hi,

    Try the "getCurrentURL" UDF!!

    http://cflib.org/udf/getCurrentURL