|
-
May 1st, 2002, 03:32 PM
#1
Thread Starter
Member
Session Arrays
I am trying to reference an array from multiple pages during a session. I guess the first question is if this is possible If it is, here is the situation:
On the first instance of the page, I am selecting 20 numbers from an database and storing them in an array. Then the corresponding question of array[1] is selected and dispalyed. Once the user answers this question, I am reloading the same page, but skipping the script that populates the array. However, I still want to be able to reference the next location of the array that was populated when the page was originally loaded. Is this possible and if so, how.
Thanks everyone...
-
May 1st, 2002, 04:05 PM
#2
Frenzied Member
A quick and dirty test that should answer your question.
Code:
<% @Language="VBScript" %>
<%
Option Explicit
%>
<html>
<head>
<title>Test ASP</title>
</head>
<body>
<%
If Session("CallCount") = "" Then
Session("CallCount") = 1
Dim Foo(2)
Foo(0) = "Bar"
Foo(1) = "Blah"
Session("myFoo") = Foo
Response.Write "<p>Reload</p>"
Else
Dim myFoo
myFoo = Session("myFoo")
Response.Write "<p>" & myFoo(0) & "</p>"
End If
%>
</body>
</html>
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|