• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Capture full URL with CF CGI variable

Participant ,
Dec 02, 2008 Dec 02, 2008

Copy link to clipboard

Copied

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?

Views

5.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 02, 2008 Dec 02, 2008

Copy link to clipboard

Copied

Hi,

Try the "getCurrentURL" UDF!!

http://cflib.org/udf/getCurrentURL

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 02, 2008 Dec 02, 2008

Copy link to clipboard

Copied

<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/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 02, 2008 Dec 02, 2008

Copy link to clipboard

Copied

Daverms, this UDF worked perfectly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 02, 2008 Dec 02, 2008

Copy link to clipboard

Copied

Azadi - your method worked excellently, too! Thanks to both of you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 03, 2013 Aug 03, 2013

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 03, 2013 Aug 03, 2013

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation