Passing an Array as a QueryString

Results 1 to 3 of 3

Thread: Passing an Array as a QueryString

  1. #1
    Join Date
    Dec 1969

    Default Passing an Array as a QueryString

    I would like to open up another Asp Page an pass in an Array of Data. Can I do This ?<BR>Thanks.

  2. #2
    Join Date
    Dec 1969

    Default Either:

    1) Store it as a session variable, or<BR>2) Join() the array, and then Split() it on the next page.<BR><BR>Remember, however, that you have approximately 500 characters on the querystring (some browsers allow more, but 500 is a good estimate), and that includes the full URL to the script.<BR><BR>If it&#039;s a big array, you can&#039;t use the querystring.<BR><BR>Craig.

  3. #3
    Join Date
    Dec 1969

    Default RE: Passing an Array as a QueryString

    of course, of course my good man. here&#039;s how:<BR><BR>for x = lbound(arrBlah) to ubound(arrBlah)<BR> &#039;* loop from the first entry in the array to the last<BR>strQueryString = strQueryString & "item" & x & "=" & arrBlah(x) & "&"<BR>next<BR><BR>this will make strQueryString into:<BR><BR>item0=value0&item1=value1&item2=value 2, etc<BR><BR>or you could miss out the "item" & x & "=" <BR>and just have "item=" then you would get a result like this:<BR><BR>item=value0&item=value1&item=value2, etc<BR><BR><BR>which you could split into a new array when it hits the next page, for example:<BR><BR>strItems = request("item")<BR>arrBlah = split(strItems, ",")<BR><BR>and now arrBlah is just how it was on the last page!<BR><BR>alternatively you could just chuck it into a session variable like i would, but that depends on big the array is i suppose!<BR><BR>Hope that helps<BR><BR>Jonny T<BR>

Posting Permissions

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