Ask a Question related to Coldfusion Database Access, Design and Development.
-
quiero mas #1
Sessions Variable
HI everyone
Been trying to get sessions variables happening
have set up a collection called 'shoppingcart'
now im trying to get my add button to work
after a user chooses a symptom they can return to the alphabete key and choose
another letter and choose another symptom. Once the user has choosen all their
symptoms they can procede to a form to complete other personal information.
i can get the abc...z working fine pulling data from the database
then on the next to each entry i originally had a checkbox which i thought the
user could check and add with a button.
problem is that i cant seem to get the ad button working properly.
I created a datasource called #application.ds# which dsn is my symptom table
Im quite sure the problem is in the button code but i cant work it out
Any advice or help would be most appreciated
ABC...Z Page Code
<cfquery name="q1" datasource="#application.ds#">
select distinct left (symptom, 1) AS firstletter
from symptoms
order by left (symptom, 1)
</cfquery>
<cfif q1.recordcount>
<cfoutput query="q1">
<font size=6 face=arial><b><a
href="categoryDetail.cfm?firstletter=#firstletter# ">#firstletter#</a></b></font>
</cfoutput>
</cfif>
Button Code
<cfparam name="formVal" default="Add to Cart">
<cfparam name="symptom" default="">
<cfif isdefined("form.submit")>
<cfif form.submit eq FormVal>
<cf_addItem symptom="#form.addsymptom#">
</cfif>
</cfif>
<cfif len(id)
<cfoutput>
<center>
<FORM action="#getfilefrompath(cgi.script_name)#?firstle tter=#firstletter#"
method="post">
<input type="hidden" name="addsymptom" value="#q3.symptom#">
<input type="submit" name="submit" value="#formVal#">
</form>
</center>
</cfoutput>
</cfif>
Add Item Code
<cfif isdefined("attributes.symptom") >
<cfscript>
if (not(isdefined("session.cart"))) {
session.cart = structnew();
}
tempvalue = listtoarray('#attributes.symptom#');
if (not(structKeyExists(session.cart, attributes.symptom))) {
StructInsert(session.cart,attributes.symptom,tempv alue);
}
else {
tempvalue[4]=session.cart[attributes.symptom][4];
StructUpdate(session.cart,attributes.symptom,tempv alue);
}
</cfscript>
</cfif>
Results Page
<cfparam name="URL.firstletter" default="Z">
<cfparam name="PageNum_q3" default="1">
<cfquery name="q3" datasource="#application.ds#">
select symptom, ??
from symptoms
where symptom like '#url.firstletter#%'
</cfquery>
<cfoutput query="q3">
<b><i><font face="arial" size=4>
<input type="checkbox" name="checkbox" value="checkbox">
#q3.symptom#</font></i></b><br>
<a href="itemDetail.cfm?#q3.symptom#"></a>
<!--- Insert Shopping Cart Functionality Here --->
</cfoutput><cfoutput query="q3">
</cfoutput><cfoutput query="q3">
<cfinclude template="addButton.cfm">
</cfoutput>
<a href="catalog_getCategories.cfm?firstletter=#first letter#"><< Back</a>
quiero mas Guest
-
HELP : problem with sessions, and php code stored within a variable
I am getting the following error on a peice of code of mine: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or... -
Database sessions and file sessions
Can database sessions and file system sessions co-exist on the same server. I have 2 applications that use sessions. One uses the standard php... -
Sessions variable access in multithreaded asp.net
"Kelvin Foo Chuan Lyi" <vm@vmirage.cjb.net> wrote in message news:3c84a272.0307280615.48cb160f@posting.google.com... If you are getting the error... -
Sessions variable HELP please
Hi Can Someone tell me why This doesnąt work: Page 1 $_SESSION = 'A non'; Page 2 Echo $_SESSION;



Reply With Quote

