ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 14th, 2003, 10:52 AM
victoria207 victoria207 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Baltimore, MD
Posts: 12 victoria207 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 23 sec
Reputation Power: 0
Angry Data persistance in Cold Fusion

I have 5 pages taking employee information as input (Personal data, Education, Working Exp, Projects, Skills etc) I am using javascript for client side validation and Cold Fusion on the server side. I want to persist data from first to last form so that at end of submission user can verify the data from all 5 pages , then it will be posted in the data base. Please help!!! Thanks

Reply With Quote
  #2  
Old August 14th, 2003, 03:01 PM
drgroove's Avatar
drgroove drgroove is offline
Moderator Emeritus
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Feb 2002
Location: Scottsdale, AZ
Posts: 7,174 drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level)drgroove User rank is General 17th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Days 23 h 48 m 33 sec
Reputation Power: 2131
You could write the filled-out data to <input type=hidden> tags on each subsequent page of the form... that way, all of the data stays until you're ready to submit to the DB.

Alternately, you could write the data to the database in sections, but you would need to determine which user was writing to which part of the DB as you went along. I'm sure CFML has a 'session' ID similar to that of PHP that you could use to link the 2 for this purpose.
__________________
DrGroove, Devshed Moderator | New to Devshed? Read the User Guide | Need ServiceNow consulting or ITIL process design? Connect with me on LinkedIn

Reply With Quote
  #3  
Old August 14th, 2003, 03:17 PM
victoria207 victoria207 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Baltimore, MD
Posts: 12 victoria207 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 23 sec
Reputation Power: 0
Code

<input type=hidden> tag is not an option here since I have about 100 questions and 5 pages to post. I was thinking about using session variables, but never built anything using session variable from scratch. SO if someone can send me a code example on how to use session variable I would appretiate it!
Thanks

Reply With Quote
  #4  
Old August 14th, 2003, 06:44 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,091 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 2 h 53 m 27 sec
Reputation Power: 966
Using session variables in CF is absurdly easy.

First, make sure you put a <cfapplication> somewhere that will run on each request, most likely the Application.cfm file. Something like this:

<cfapplication name="myAppName" sessionmanagement="Yes">

Then, when you want to set a session variable, you do:

<cfset session.myVar = "whatever">

To read it, you do:

#session.myVar#

That's it.

The only other thing to note is that if you plan on a decent load on the server, you should use <cflock> to lock reads and writes to session variables. Since they are memory-resident, you must avoid memory contention by locking if you expect a heavier load. But this is not required (it is recommended though).

Example:

<cflock timeout="" throwontimeout="No" name="#createUUID()#" type="EXCLUSIVE">
<cfset session.myVar = "whatever">
</cflock>

<cflock timeout="" throwontimeout="No" name="#createUUID()#" type="READONLY">
<cfset someLocalVar = session.myVar>
</cflock>

A well thought out application will minimize the need for locking by locking once at the start of the request to copy the session vars into the local scope, and then at the end of the request copy them back into the session scope.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Data persistance in Cold Fusion

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap