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

#CGI.SCRIPt_NAME#

New Here ,
Apr 03, 2007 Apr 03, 2007

Copy link to clipboard

Copied

I am creating a secure page that uses variables for the url from the page before it. My coldfusion MX book tells me to use the #CGI.SCRIPt_NAME# variable so that when the user logs into the page it will continue to where they wanted to go but this does not work for me. I get an error saying that the variable could not be found. Is there a way to carry the url and variables that it was using at first through all of the pages it has to run through to check the users authentication? Thanks
TOPICS
Advanced techniques

Views

4.2K

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 ,
Apr 03, 2007 Apr 03, 2007

Copy link to clipboard

Copied

#cgi.script_name#?#cgi.query_string#

--

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
New Here ,
Apr 03, 2007 Apr 03, 2007

Copy link to clipboard

Copied

quote:

Originally posted by: Newsgroup User
#cgi.script_name#?#cgi.query_string#

What's that going to do for me?

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
Community Expert ,
Apr 04, 2007 Apr 04, 2007

Copy link to clipboard

Copied

CGI.SCRIPT_NAME is the path to the script that is currently executing. When your users "continue to where they wanted to go", the path to the new page becomes the new value of CGI.SCRIPT_NAME, which is in general different from that of the previous page. Could there possibly be some confusion there?

Is there a way to carry the url and variables that it was using at first through all of the pages it has to run through to check the users authentication?
Yes. For example, Coldfusion can carry them from page to page as session, URL or hidden form variables.

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 ,
Apr 03, 2007 Apr 03, 2007

Copy link to clipboard

Copied

> I get an error saying that
> the variable could not be found.

You shouldn't get an error saying a CGI-scoped variable was not found. CF
always - for some daft reason - treats any non-existent CGI variable as an
empty string. isDefined() on a CGI variable always returns true.
structKeyExists() is more reliable, though, and will return false if indeed
the variable does not exist.

--
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
Advocate ,
Apr 04, 2007 Apr 04, 2007

Copy link to clipboard

Copied

LATEST
CGI.Query_String contains a tokenized list of all of your URL variables (e.g. myvar=1&hello=world). If you would like to learn a little more about what information you have available to you in the CGI variables, simply do a <cfdump var="#CGI#">. That should point you in the right direction.

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