Hi All,
I'm new at ASP, so bear with me please. And if I ask questions better
suited for another list, feel free to tell me.
I am developing a web application with Apache::ASP. I want to track
visitors across pages. This way I can send them back to the page last
visited, or maybe a couple of pages back depending on the situation. Login,
for instance. If they try to do something that requires login, I can take
them through the process, but land them back on the page from which the
process was initiated.
My first thought is to use something like $Session->{'history'} = [] to
create an anonymous array reference, perhaps. Either way, I have tried
using Script_OnEnd to stack each page visited on this array, but I'm having
no luck.
Here is an example of my global.asa and what I am trying to do in my
script:
#global.asa#
sub Session_OnStart{
$Session->{'history'} = [];
}
sub Script_OnEnd{
my $page_name = $Request->{'SCRIPT_NAME'};
push @{$Session->{'history'}}, $page_name;
}
#something.asp#
$Response->Redirect("$Session->{'history'}->[$#{$Session->{'history'}}]");
But this doesn't work, with the error saying I can't use an undefined value
to reference an array element, or some such.
I will admit that I am trying to accomplish this totally blind. I have no
knowledge of the idioms involved in session tracking, etc. I am beginning
to believe I am trying to reinvent the wheel. Any help will be appreciated.
Are these proper uses for these events(Session_OnStart & Script_OnEnd)?
Am I correct in believing that the Script_OnEnd event occurs at the end of
each page loading?
It is my understanding that the term "script" in a web-based scenario would
refer to each "page", e.g. foo.asp and bar.asp would be two "scripts", each
with their own OnStart and OnEnd events. Is this correct?
Thanks so much. I have spent a couple of days on this trying to work it
out myself rather than lean on y'all experts to handle such a low-level
issue.
Thom Crane
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]