Copy link to clipboard
Copied
I have a page that edits a database called (edit_record.cfm). The link from page A will go to the edit page that will allow for changes. After the update to the database from the (update_record.cfm), my cflocation tag will go back to page A. However right before I submit my finished records to my manager on my (email_review.cfm) page, I can click on each record to edit one last time. which when clicked would go to the same (edit_record.cfm).
What i want to do is to have a have my cflocation go to any of my previous pages when my database updates regardless if the previous page is my (edit_record.cfm) or (email_review.cfm)
Copy link to clipboard
Copied
When either edit_record.cfm or email_review.cfm loads, set an input type="hidden" field called "returnTo" and give it a value of #cgi.script_name#. After the database stuff, CFLOCATION to that form field value.
^_^
Copy link to clipboard
Copied
Regarding, "What i want to do is to have a have my cflocation go to any of my previous pages"
You can't. You have to go to a specifc page. If there is conditional logic involved, that's a different story. Also, if you want to pick a previous page at random, that's also possible although it seems rather silly.
Copy link to clipboard
Copied
If you want it to return to the page that called it try this:
<cflocation url="#cgi.http_referer#>
the referer is the page that called your current page.
Copy link to clipboard
Copied
if you dump the <cfdump var="#cgi#"> you will find all sorts of goodies in there.