PDA

Click to See Complete Forum and Search --> : Need Help! Cookie or DB issue.


jesus4u
Feb 28th, 2001, 09:24 AM
I have 2 forms that my users are using to sign up with. What can I do to preserve the first form's information while they move to the second form and then after they fill out the second form then write it to the database?

I have been trying cookies but can I add to the current cookie the second form's information? Like writing to a DB but a cookie instead?

If I have to write to a DB after the first form has been filled out, then how do I add the second form to the correct record?

jdavison
Feb 28th, 2001, 09:30 AM
Is this information used only in this particular process? If so I wouldnt use cookies or sessions. I would just pass the data through to the last page and then just dump it in the db. Just use the request object to get the info from the form on the next page and put it in a hidden input. then when you submit the form on that page it passes it for the next page to request. Since they ar hidden the user wont see it and your not taking up server memory or storing data on there pc. plus if they have cookies of you not screwed.

jesus4u
Feb 28th, 2001, 09:32 AM
Thanks for the response.What you are saying makes sense. Can you show me how to pass the data through to the last page? I am using FP2000 as the editor.

jdavison
Feb 28th, 2001, 09:40 AM
are you using asp?

in you asp code do the following



<variable>=request.form("<form field name>")



This will request the data in the field from the submitted form. You would then create a hidden input in the next form for that field



<input type=hidden name=<name of field> value="<%=<variable>%>">



Now that will put the data in the new hidden input. You would have to keep doing this until you got to your last page and then just do the request.form to put it into whereever you need it.

jesus4u
Feb 28th, 2001, 10:07 AM
Do I place this code on the form where the info is being passed through?

jesus4u
Feb 28th, 2001, 10:16 AM
Do I place the code within the <%%> like this ?

<Reg1FirstName>=request.form("<txtReg1FirstName>")

jesus4u
Feb 28th, 2001, 10:17 AM
or like this?

Reg1FirstName=request.form("txtReg1FirstName")

jdavison
Feb 28th, 2001, 10:21 AM
like this

<% Reg1FirstName=request.form("txtReg1FirstName") %>

the <% and %> signify the begining and ending of the asp code for the server. you can put multiple commands inside them.

Try visiting

http://www.asp101.com/

its a decent site on basic asp coding

jesus4u
Feb 28th, 2001, 10:22 AM
ok thanks just confirming what I already know

jdavison
Feb 28th, 2001, 10:26 AM
Any time:)

jesus4u
Feb 28th, 2001, 10:38 AM
ok i have this code on the first form:
<%

Reg1FirstName=request.form("txtReg1FirstName")
Reg1LastName=request.form("txtReg1LastName")
Reg1Type=request.form("lstReg1Type")
Reg1Badge=request.form("txtReg1Badge")

Reg2FirstName=request.form("txtReg2FirstName")
Reg2LastName=request.form("txtReg2LastName")
Reg2Type=request.form("lstReg2Type")
Reg2Badge=request.form("txtReg2Badge")

Reg3FirstName=request.form("txtReg3FirstName")
Reg3LastName=request.form("txtReg3LastName")
Reg3Type=request.form("lstReg3Type")
Reg3Badge=request.form("txtReg3Badge")

Reg4FirstName=request.form("txtReg4FirstName")
Reg4LastName=request.form("txtReg4LastName")
Reg4Type=request.form("lstReg4Type")
Reg4Badge=request.form("txtReg4Badge")

Reg5FirstName=request.form("txtReg5FirstName")
Reg5LastName=request.form("txtReg5LastName")
Reg5Type=request.form("lstReg5Type")
Reg5Badge=request.form("txtReg5Badge")

Reg6FirstName=request.form("txtReg6FirstName")
Reg6LastName=request.form("txtReg6LastName")
Reg6Type=request.form("lstReg6Type")
Reg6Badge=request.form("txtReg6Badge")

Reg7FirstName=request.form("txtReg7FirstName")
Reg7LastName=request.form("txtReg7LastName")
Reg7Type=request.form("lstReg7Type")
Reg7Badge=request.form("txtReg7Badge")

Reg8FirstName=request.form("txtReg8FirstName")
Reg8LastName=request.form("txtReg8LastName")
Reg8Type=request.form("lstReg8Type")
Reg8Badge=request.form("txtReg8Badge")

Reg9FirstName=request.form("txtReg9FirstName")
Reg9LastName=request.form("txtReg9LastName")
Reg9Type=request.form("lstReg9Type")
Reg9Badge=request.form("txtReg9Badge")

Reg10FirstName=request.form("txtReg10FirstName")
Reg10LastName=request.form("txtReg10LastName")
Reg10Type=request.form("lstReg10Type")
Reg10Badge=request.form("txtReg10Badge")

%>

Do I then put the

<input type=hidden name=<name of field> value="<%=<variable>%>">

on the second form requesting this information or the other way around?

jesus4u
Feb 28th, 2001, 11:35 AM
Now I get this crazy error:

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/ReclaimAmerica.org/Conference/register3.asp, line 153, column 15
Response.Write(<Reg1FirstName>)
--------------^

I don't even have this code on the page.

Any suggestions?