Session Variables Disappearing!

X

xx75vulcan

I Used to have a really long form. It's an employement form, that
allows applicants to apply online.

I have split the MS ACCESS database into several tables.
So I broke the application up into two asp pages. First page (asp
form-built by Frontpage)
asks personal contact info and upon clicking submit stores to a
database table called personal. The confirmation page (second asp form)
is the second form where they will answer all the professional
questions, and upon clicking submit stores to a table called
professional.

I need to be able to have the second form remember the user's SSN
(inserted in the first form) so that later, when we quiry the database,
and want to pull back
information, we can pull from both tables, simply by using the SSN as
the key.

I can't figure out how to have the first form submit to a database, and
pass the "SSN" field's value to the second form.

I've tried Session Variables, but they never seem to pull the value of
the variable through.

For simplicity, here's the links to the two asp forms:

http://www2.rockwood.k12.mo.us/candidates/test.asp
http://www2.rockwood.k12.mo.us/candidates/test2.asp

If you could, by looking at the page code, tell me what to put into
each file, and exactly where to put it.

Thanks for your help!

Chris
 
S

Stefan B Rusynko

Server side code (your ASP coding) is not visible in the browser
(it has already been processed server side)

Your 1st page action at http://www2.rockwood.k12.mo.us/candidates/test.asp is to test.asp
- presumably where (w/ server side coding) you write page 1 of the form to the DB
- and redirect to test2.asp
Similarly w/ http://www2.rockwood.k12.mo.us/candidates/test2.asp your form action is test2.asp
- presumably where (w/ server side coding) you write page 2 of the form to the DB

So in test.asp in your processing section set
<% Session("SSN")=Request.Form("SSN")%>

And on test1.asp set a hidden form field for it as
<input type="hidden" name="SSN" value="<%=Session("SSN")%>">

Alternatively do your processing for test.asp form 1 on test 1.asp where you already have Request.Form("SSN") available for use in
form 2

PS
highly recommend you reconsider NOT using the SSN as an ID on a non secure page and storing it in your DB
- you are leaving yourself (responsible) and your users, wide open to identity theft

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I Used to have a really long form. It's an employement form, that
| allows applicants to apply online.
|
| I have split the MS ACCESS database into several tables.
| So I broke the application up into two asp pages. First page (asp
| form-built by Frontpage)
| asks personal contact info and upon clicking submit stores to a
| database table called personal. The confirmation page (second asp form)
| is the second form where they will answer all the professional
| questions, and upon clicking submit stores to a table called
| professional.
|
| I need to be able to have the second form remember the user's SSN
| (inserted in the first form) so that later, when we quiry the database,
| and want to pull back
| information, we can pull from both tables, simply by using the SSN as
| the key.
|
| I can't figure out how to have the first form submit to a database, and
| pass the "SSN" field's value to the second form.
|
| I've tried Session Variables, but they never seem to pull the value of
| the variable through.
|
| For simplicity, here's the links to the two asp forms:
|
| http://www2.rockwood.k12.mo.us/candidates/test.asp
| http://www2.rockwood.k12.mo.us/candidates/test2.asp
|
| If you could, by looking at the page code, tell me what to put into
| each file, and exactly where to put it.
|
| Thanks for your help!
|
| Chris
|
 
X

xx75vulcan

ok, I added the <% Session("SSN")=Request.Form("SSN")%> to test.asp
(first form).

Then I added the hidden field <input type="hidden" name="SSN"
value="<%=Session("SSN")%>"> to test2.asp (second form) and made sure
the wizzard linked the hidden Field SSN to a field in the database.

But....It's not storing any value for the hidden SSN field from the
second form. It's leaving that field in the database record empty.

I'm not sure I follow when you said to have "form 1 post to test1.asp
where you already have Request.Form("SSN") available for use in form
2." Does that mean I need to build a new page (called test1.asp) and
instead of having the first form post directly to the database, post to
an extra form? You asked if your understanding of the way the two pages
(asp forms) were set up in your first post are correct, and they are
indeed exactly correct.

I wonder, instead of using session variables, is there a way to sort
through the string two strings called:
Session("FP_SavedFields")=arFormFields0
Session("FP_SavedValues")=arFormValues0

whereas arFormFields0() and arFormValues0() are the two default
variables FP uses if you do not specify a confirmation page.

Sort through them on the second form page, and have the value be stored
in the hidden SSN field?

Here are the variables from the ASP code in test.asp (first form)

arFormFields0(21) = "SSN"
arFormDBFields0(21) = "SSN"
arFormValues0(21) = Request("SSN")

thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top