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

using onRequest()

Explorer ,
May 09, 2007 May 09, 2007

Copy link to clipboard

Copied

What value does CF pass through the onRequest() method into arguments.targetPage? I'm trying to set up URL obfuscation using URL variables that are encoded with encrypt() and decrypt(). I'm saving a CGI variable (used to log into the larger application) as a variable called Session.ThisUser; what I want to do is encrypt this string value and append it to the incoming URL. However, if I do this:

<cfinclude template="#arguments.targetPage#&x=#myEncryptedString#">

It says it can't find the included page.

I then tried this:

<cfset zVal = url.z>
<cfinclude template="#arguments.targetPage#?z=#zVal#&x=#myEncryptedString#">

Which didn't work either.

So, what does the onRequest() method do with passed-in URL variables, and how can I append other URL variables to outgoing targets?

Thanks.

UPDATED QUESTION: Essentially, I would like to know the correct syntax for adding URL variables to the arguments.targetPage within the onRequest() method. No, it is not as straightforward as adding a string to the end of it; that simply doesn't work. Someone please explain. Thanks.
TOPICS
Advanced techniques

Views

369

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
Contributor ,
May 10, 2007 May 10, 2007

Copy link to clipboard

Copied

You cannot add URL parameters to a page in CFINCLUDE. the attribute TEMPLATE is a logical path to a CF page.
Don't you are confused with CFLOCATION ?
If you need to include a page and the pages process URL variables, define then before include the page (using CF or CFPARAM) :
<cfset URL.z=value1>
<cfset URL.x=value2>
<cfinclude template="#arguments.targetPage#>

Regards

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
Explorer ,
May 10, 2007 May 10, 2007

Copy link to clipboard

Copied

What I want to do is append URL variables to the arguments.targetPage value in the onRequest() method. I've tried using cfset and cfparam to set url variables prior to calling the targetPage, but no URL variables are appended to the passed URL. Is there another way to do this?

For anyone at Adobe reading this, the documentation on the onRequest() method is spotty at best. It would help to have examples of editing and filtering pages, rather than saying it "can be done" and never explaining how.

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 ,
May 10, 2007 May 10, 2007

Copy link to clipboard

Copied

LATEST
When you say no URL variables are appended to the passed URL, do you mean:

1) The URL variables you set in the onRequest() method do not exist on the CFM template in question

or

2) The URL variables you set are not appearing in your browser's URL address?

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