Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Can I Best Structure an Online Application? 2

Status
Not open for further replies.

majorbroncosfan

Programmer
Feb 23, 2001
121
US
I currently am working on putting together an online job application for our company. So far, there are about 129 different fields to fill out. How can I pass the data between the different pages without having 114 hidden fields on each page? If anybody wants to see what I'm talking about, go to
This is not yet live or connected to a database, but has the basic layout already in place.
 
save it in as a cookie
or
as in a session variable
or
even in a text file

regards Unicorn11
unicorn11@mailcity.com

[red]Luck is not chance, it's toil; fortune's expensive
smile is earned.[red]
 
text file = good ;-)

That way, it will work if someone has their cookies turned off.
penny.gif
penny.gif
 
Use Session variables in your global.asa

Sub Session_OnStart
Session("field_1")=""
' ....
Session("field_n")=""
End Sub

and in your asp use this


<%myField_1=Session(&quot;field_1&quot;)%>
 
if someone has their cookies turned off...it will not affect the session state which is controlled on the server
 
How can I connect to my database fields from global.asa using session variables?
 
---page1.asp------------------------------
<form method='post' action='page2.asp'>
<input type='text1' name='item'>
<input type='text2' name='item'>
<input type='text3' name='item'>
.
.
.
<input type='textN' name='item'>

<input type='submit' value='Submit'>
</form>
-------------------------------------------
===========================================
---page2.asp-------------------------------
<%
session(&quot;item1&quot;) = request.form(&quot;field1&quot;)
session(&quot;item2&quot;) = request.form(&quot;field2&quot;)
.
.
.
session(&quot;itemN&quot;) = request.form(&quot;fieldN&quot;)

response.redirect(&quot;page3.asp&quot;)
%>
-------------------------------------------
===========================================
---page3.asp-------------------------------

<%
response.write(&quot;These are your items:<BR>&quot;)
For count = 1 to N
Response.write session(&quot;item&quot; & count & &quot;<BR>&quot;)
Next
%>




that should work fine, minus any fine tuning you may need to do. Unless someone else knows of somthing better...
You only need the one page though to set all the items as session states. then you don't need to pass them from page to page any more...just call that item whenever you want (or until the session times out for the user). session(&quot;whatEverYouCalledItHere&quot;)

hope that helps.

-Ovatvvon










 
heh heh, sorry, no sleep in almost 48 hours now, so not payin enough attention...plus there were errors too...here:
-------------------------------------------
---page1.asp-------------------------------
<%
sql = &quot;SELECT * FROM table;&quot;
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rs.open sql, conn, 3, 3

session(&quot;item1&quot;) = rs(&quot;item1&quot;)
session(&quot;item2&quot;) = rs(&quot;item2&quot;)
session(&quot;item3&quot;) = rs(&quot;item3&quot;)
'etc etc etc etc etc etc etc etc

response.redirect(&quot;page2.asp&quot;)
%>

---page2.asp--------------------------
<%
For count = 1 to 3
response.write(&quot;&quot; & session(&quot;item&quot; & count & &quot;&quot;) & &quot;<BR><BR>&quot;)
Next
%>
 
That was actually a revelation. I've been trying to do all of my variable-handling via post and by setting up local variables on each page. Knowing how well this works, it almost allows me to maintain state throughout the application.

THANK YOU!!!!
 
be careful to not put to manny variables in your session variables because they are initialized with any visitor you have on the site and the web server could remain without memory
(something like:
dim My_Array(100000)
Session(&quot;My_Array&quot;)=My_Array

this use some memory...
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top