Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 121423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:58:07+00:00 2026-05-11T03:58:07+00:00

I’m writing an application in ColdFusion, and even though it is mostly stable, it

  • 0

I’m writing an application in ColdFusion, and even though it is mostly stable, it errors every so often. Because it has replaced the old application already, sometimes it is the users who get errors instead of me.

I’ve created a nice page that people get when they get an error that sends information to me, such as error, referrer, error on which page, line number, etc.

The only thing I can’t get to seem to work is getting the form data submitted if there is any. I don’t know what page it errored on beforehand, so I can’t just output ‘#form.field#’.

For example if:

form.abc = 1 form.def = 2 

How can i get the variable names and value from ‘form’ without knowing them beforehand?

Is this document on looping over a structure somewhere along the right path?

Also, I’m looking for a good way to store that data in a database, because that is where the other information about the error is stored, and I don’t really want to have to put it in an email to me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:58:07+00:00Added an answer on May 11, 2026 at 3:58 am

    The Form scope has a FieldNames variable which will tell you what fields were submitted.

    You can also do StructKeyList(Form) to get a list of the current variables in the scope. This one will also include FieldNames and any other variables that have since been added to the Form scope.

    Either of these could be used inside a <cfloop index='CurField' list='#StructKeyList(Form)#'> – but there are easier ways…

    If you are on CF8 you can convert the scope to a string nice and easily with serializeJson() and deserializeJson() functions, which could then be stored in a suitable database field.

    If you’re on CF6..7 then you can download a CFC called cfjson from riaforge which mimics these functions.

    Finally, if you’re on earlier versions of CF, or have an odd aversion to using JSON for storage, you can roll your own with an even simpler loop to the one hinted above – a collection loop lets you loop directly through a Structure or Scope – note that some annoying person picked ‘item’ rather than ‘index’ as the attribute for these.

    Since we know Form variables are all simple objects (i.e. strings) I’ve elected for a basic key=value[newline]key=value[newline]... format, which is easy to reverse also.

    Encoding:

    <cfset Output = '' /> <cfloop item='CurField' collection='#Form#'>     <cfset Output = Output & CurField & '=' & Form[CurField] & Chr(10) /> </cfloop>  <cfoutput>#Output#</cfoutput> 

    Decoding:

    <cfset FormData = StructNew()/> <cfloop index='CurLine' list='#Output#' delimiters='#Chr(10)#'>     <cfset FormData[ListFirst(CurLine,'=')] = ListRest(CurLine,'=') /> </cfloop>  <cfdump var='#FormData#'/> 

    One last important note: As with all user-supplied variables (Form,Url,Cookie scopes) you must make sure you handle them correctly to prevent security holes – specifically make sure you are using cfqueryparam for all your database queries – don’t want to sidetrack too far, but feel free to ask another question if you need any help with cfqueryparam.

    Hope this helps. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 154k
  • Answers 154k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer As the author of http://www.langpop.com my approach is to find… May 12, 2026 at 10:32 am
  • Editorial Team
    Editorial Team added an answer Bind the text field's value to one of your object's… May 12, 2026 at 10:32 am
  • Editorial Team
    Editorial Team added an answer Not really, but mostly because it generally doesn't make sense.… May 12, 2026 at 10:32 am

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.