3 Replies Latest reply: Jul 21, 2008 10:35 AM by kodemonki RSS

    Page Redirecting

    kodemonki Community Member
      I have a page that enrolls clients in programs which is supposed to redirect to a page that lets the client pick a consultant. However, instead of redirecting to the correct page, it redirects from the page it just came from. It does this even if I take out all of the cflocations. I thought that if I took out all the cflocations it would just do whatever inserts, etc. are necessary then not go anywhere, and I could just look at debugging output. The program in question DOES return events from GrabEventData and therefore should go to ConsultantSelection.cfm, instead it is going back to DealerManager.cfm, even if I take out all references to DealerManager (either comment out or delete entirely).

      I've only posted code that should happen when a program is selected, the rest of the code on the page is the form to select the program.

      Any ideas? Thanks!
        • 1. Re: Page Redirecting
          Dan Bracuk Community Member
          When I get unexpected results with if/else logic, I troubleshoot it like this:

          <cfif x is 1>
          true <br />
          <cfdump var = "#x#">
          <cfabort>
          <cfelse>
          false
          <cfdump var = "#x#">
          <cfabort>
          </cfif>
          • 2. Re: Page Redirecting
            kodemonki Community Member
            Bad news, I changed ALL of the code I posted to:
            <cfif selectProgram EQ 3>
            SDS
            <cfelseif selectProgram EQ 42>
            1tlb
            <cfelse>
            dgim
            </cfif>

            And I still get the same response. I'm pretty sure the code is actually updating on the server because when testing (the originally posted code) I changed the user_id from #session.user_id# to 6666666 and it showed up correctly in the database.
            • 3. Re: Page Redirecting
              kodemonki Community Member
              I had to change

              <cfif find(selectProgram,program_list)>
              <cflocation url="dgim/enroll_dgim.cfm?selectProgram=#selectProgram#&enrollment=#enrollment#&selectDea ler=#selectDealer#&signer=#replace(signer,' ','_','ALL')#">
              </cfif>

              to

              <cfloop query="dgim_program">
              <cfif selectProgram EQ id>
              <cflocation url="dgim/enroll_dgim.cfm?selectProgram=#selectProgram#&enrollment=#enrollment#&selectDea ler=#selectDealer#&signer=#replace(signer,' ','_','ALL')#">
              <cfbreak>
              </cfif>
              </cfloop>

              because it was checking for '3' in a list, not 3.