Store the values in the database.
Rather than inventing a field for each value use XML.
Create a User Config table with the fields (I'm using SQL Server parlance)
:-
UserID int, Key varchar(512), XML ntext
When a page receives the search request it can create an XML DOM and store
the values in the XML:-
Dim oDOM
Set oDOM = Server.CreateObject("msxml2.DOMDocument.3.0")
oDOM.loadXML "<config />"
AddElem oDOM, "myField", Request.Form("myField")
....
Function AddElem(parent, name, value)
Set AddElem = parent.createElement(name)
If Not IsNull(value) Then
AddElem.Text = CStr(value)
End If
End Function
The user choices can then be saved from oDOM.xml property in the UserConfig
table. I use the the page URL as a key e.g.,
'/myFolder/mySubFolder/myPage.asp'
When the user revisits the page you use the UserID and the page URL to fetch
an XML string that you can then load an XML DOM with. You can subsequently
retrieve the values for the fields from the XML.
This approach is memory efficient and survives cross sessions (potentially
allowing you to drop the session timeout).
Anthony. |