3 Replies Latest reply on May 10, 2007 3:06 PM by insuractive

    using onRequest()

    pblecha
      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.
        • 1. Re: using onRequest()
          Sojovi
          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
          • 2. Re: using onRequest()
            pblecha Level 1
            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.
            • 3. Re: using onRequest()
              insuractive Level 3
              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?