Session Variables

Results 1 to 3 of 3

Thread: Session Variables

  1. #1
    Dean M Guest

    Default Session Variables

    I would like to have the user select from a set of five checkboxes and then have the choice they made be stored as a session variable. I would then use that answer throughout the rest of the site to present them with the appropriate values from an access database. Is this possible? How do you set a session variable from a list of checkboxes? Any input would be a big help!<BR><BR>Thanks,<BR>Dean M

  2. #2
    Join Date
    Dec 1969

    Default RE: Session Variables

    Here you go. This example assumes you have named your checkboxes like check0 to check5 and sets an array element either false or true.<BR><BR>&#060;%<BR>Dim CheckArray(5)<BR><BR>For I = 0 to 4<BR> If Request.Form("Check" & I) = "on" Then<BR> CheckArray(I) = true<BR> Else<BR> CheckArray(I) = false<BR> End If<BR>Next<BR>%&#062;<BR><BR>Hope that helps<BR><BR>Pete

  3. #3
    Join Date
    Dec 1969

    Default RE: Session Variables - I forgot a bit!

    Oh you need to do this too :<BR><BR>Session("CheckBoxes") = CheckArray<BR><BR>Then when you want to use the results on each page you need it you do this :<BR><BR>Dim CheckArray(5)<BR>Dim I<BR><BR>CheckArray = Session("CheckBoxes")<BR><BR>Then use it as a normal array.<BR><BR>Hope that helps some more ;)<BR><BR>Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts