Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
emmim44 #1
Not an easy question--session
hi all,
I have a search form, and a result page..The result page page shows edit and
deleted buttons..when i updated or delete one record....after that instead of
taking me back to the result page...it takes but it page come with all records
in db..I am locking the form variables but end I am getting an err..Any help
will be app.
The result page has this segment:
<cfparam name="url.up" default="">
<cfparam name="form" default="">
<!---Controlling the session--->
<cfif isdefined("form.FieldNames")>
<cflock type="readonly" timeout="600" scope="session">
<cfwddx action="cfml2wddx" input="#form#" output="session.form">
</cflock>
<cfelse>
<cfif isdefined("url.UseSession")>
<cflock scope="session" type="readonly" timeout="1800">
<cfwddx action="wddx2cfml" input="#session.form#" output="form">
</cflock>
</cfif>
</cfif>
The ERROR is:
------------------------------------------------------
Element FORM is undefined in SESSION.
The error occurred in
C:\CFusionMX\wwwroot\Denemeler\PhoneBook\SearchPhn Results.cfm: line 19
17 : <cflock scope="session" type="readonly" timeout="1800">
18 :
19 : <cfwddx action="wddx2cfml" input="#session.form#" output="form">
20 :
21 : </cflock>
After deleting or updatating I am forwarting the people back to result page...
------------------------
<cflocation url="SearchPhnResults.cfm?UseSession=2&Up=Record has been
Updated!!" ADDTOKEN="NO">
emmim44 Guest
-
I have an easy question.
I want to create plan - add a texture to it - create a second plan then add that same original texture to the second plane. When I attempt to add... -
Easy question = easy answer?
Well, so I'm pretty new with Freehand, at the mo running with MX and havin' a problem (not big, but anyway)... I'm creating some cards and they... -
Easy PHP question
Im trying to send a variable via GET to a php script like so: <a href="process.php?id=test & test">Link</a> Leaving spaces is no problem, but... -
Easy Question/Easy Answer
Ok, this is all i want to know how to do, i made a text link, now when someone rolls over it with their pointer i want it to change color. Simple? -
very easy question!!!!
ÇÁ¶óÀÓ½´Áî wrote: I recommend you keep a box of tissues beside your computer when you are coding in PHP. -
mxstu #2
Re: Not an easy question--session
Without seeing the rest of the code it is difficult to tell a) what variables
you are passing, b) what pages you are passing them to, and more importantly,
c) what is the scope of the variables being passed? A few problems I do notice
are:
1. Since you are updating the value of a session variable, you should be using
an "exclusive" lock, not "readonly".
....
<cfif isdefined("form.FieldNames")>
<cflock type="readonly" timeout="600" scope="session">
<cfwddx action="cfml2wddx" input="#form#" output="session.form">
</cflock>
....
2. The code below doesn't check to see if #session.form# exists.
<cfif isdefined("url.UseSession")>
<cflock scope="session" type="readonly" timeout="1800">
<cfwddx action="wddx2cfml" input="#session.form#" output="form">
</cflock>
....
If the #session.form# variable was never set, then the code above would
result in the error
"Element FORM is undefined in SESSION".
"The ERROR is:
------------------------------------------------------
Element FORM is undefined in SESSION.
3. It's really a bad idea to use "FORM" as a variable name. A structure named
"FORM" is already used by CF. By using the same name as a system structure, you
can inadvertently overwrite the CF information or you may even end up
referencing the wrong information, due to the fact that java passes structures
"by reference". Both issues can be difficult to track down. It is better to
avoid the problem altogether by using a name other than "FORM"
mxstu Guest
-
emmim44 #3
Re: Not an easy question--session
Thank you..for the info..I changed the name from form to smth else..And
...I figure out that..in coldfusion admin server..I forgot to change the
session interval..before it was 10 sec..now I realized (after extending time
time--1 hr)I dont get error..because the variable is still valid
emmim44 Guest



Reply With Quote

