How would you go about getting user input for a connection over different webpages. Would this be done with session variables or is there another way. I dont want to have to set up connections on every webpage, can someone point me in the right direction what to do some research into.
Here is a bit of code from a site that does not have any connection strings at all on the web site.
obj_ADO.ClearParameters
lng_RecSet1 = obj_ADO.GetFreeRecordset
obj_ADO.Recordset "A_combo_Permissions_select", adCmdStoredProc, obj_Session.int_CommandTimeout, lng_RecSet1
while obj_ADO.EOF(lng_RecSet1) = 0
and
if str_Action = obj_Session.str_FileName or len(str_Action)=0 or str_Action = str_SwitchLangText then
obj_ADO.ClearParameters
obj_ADO.AddParameter "SessionID", adChar, adParamInput, len(obj_Session.str_SessionID), obj_Session.str_SessionID
obj_ADO.AddParameter "PermissionID", adInteger, adParamInput, 8, lng_PermissionID
lng_RecSet = obj_ADO.GetFreeRecordset
obj_ADO.Recordset "A_PagePermissions_select", adCmdStoredProc, obj_Session.int_CommandTimeout, lng_RecSet
Database connection
it’s normal to adopt a custom library that at least as the methods to
open connection,execute queryandclose connectionExample:
then you can simple use:
(old post message as I did not saw the
sqltagIn Classic ASP it always ends up using
Request.QueryString("myInput")orRequest.Forms("myInput")or yet a 2-in-1Request("myInput")and work from there“Connections” are made by links and form Post’s / Get’s
There are plenty of examples on the web, but here’s one
To keep variables across pages you have (as still today) 3 ways
Sessionvariable, it leaves per user sessionApplicationvariable, it leaves per website and it’s shared cross all usersCookiesfor example, the “Authorized Page access” is made by setting a
Sessionupon the correct login, forward usingResponse.Redirect("myProtectedPage.asp")and in that page normally looks like:more here