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

Page Redirecting

Engaged ,
Jul 21, 2008 Jul 21, 2008
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!
344
Translate
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

correct answers 1 Correct answer

Engaged , Jul 21, 2008 Jul 21, 2008
I had to change

<cfif find(selectProgram,program_list)>
<cflocation url="dgim/enroll_dgim.cfm?selectProgram=#selectProgram#&enrollment=#enrollment#&selectDealer=#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#&selectDealer=#selectDealer#&signer=#replace(signer,' ','_','ALL')#">
<cfbreak>
</cfif>
</cfloop>

because it was ...
Translate
LEGEND ,
Jul 21, 2008 Jul 21, 2008
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>
Translate
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
Engaged ,
Jul 21, 2008 Jul 21, 2008
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.
Translate
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
Engaged ,
Jul 21, 2008 Jul 21, 2008
LATEST
I had to change

<cfif find(selectProgram,program_list)>
<cflocation url="dgim/enroll_dgim.cfm?selectProgram=#selectProgram#&enrollment=#enrollment#&selectDealer=#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#&selectDealer=#selectDealer#&signer=#replace(signer,' ','_','ALL')#">
<cfbreak>
</cfif>
</cfloop>

because it was checking for '3' in a list, not 3.
Translate
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