Skip to main content
Inspiring
Dec 2, 2008 9:50 AM UTC
Question

Capture full URL with CF CGI variable

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 is closed to new replies. Start a new post to keep the conversation going.

    6 replies

    ssailerAuthor
    Inspiring
    Dec 2, 2008 2:54 PM UTC
    Azadi - your method worked excellently, too! Thanks to both of you!
    Translate
    Participant
    Aug 3, 2013 9:22 PM UTC

    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.

    Translate
    Inspiring
    Aug 3, 2013 9:48 PM UTC

    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

    Translate
    ssailerAuthor
    Inspiring
    Dec 2, 2008 2:52 PM UTC
    Daverms, this UDF worked perfectly.
    Translate
    Inspiring
    Dec 2, 2008 12:10 PM UTC
    <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/
    Translate
    Inspiring
    Dec 2, 2008 12:03 PM UTC
    Hi,

    Try the "getCurrentURL" UDF!!

    http://cflib.org/udf/getCurrentURL
    Translate