"But sir, our clients and servers aren't talki

Results 1 to 4 of 4

Thread: "But sir, our clients and servers aren't talki

  1. #1
    Papa Zito Guest

    Default "But sir, our clients and servers aren't talki

    This SEEMED really simple until I tried it...<BR><BR>What I want to do is have a session variable increase by 1, but only if the previous URL doesn&#039t equal the current URL (the end result basically being to not increase the variable by 1 if the user reloads the page). Since all the URL info is on the client-side, and variable is a server variable, I can&#039t figure out how to get them to affect each other this way. Is it possible?

  2. #2
    M. Robold Guest

    Default Well, make a request to start the conversation

    Use the Request.ServerVariables("URL") to find the URL they&#039re requesting. This will give you the path relative to the root.<BR><BR>EG: They go to http://www.yourpage.com/thepage.asp the Request.ServerVariables("URL") will return the string "/thepage.asp".<BR><BR>Hope that helps.

  3. #3
    M. Robold Guest

    Default Maybe I should think before I write...

    Sorry, that won&#039t solve the whole problem...what you might want to do is store the current URL in another Session variable and then not update it until you&#039ve checked it against the request.<BR><BR>IE: First check the Requested URL, then see if it matches the Session("CurrentURL"), if not, then set the Session("CurrentURL") value to equal the Requested URL and increment the Session&#039s counter variable by 1.<BR><BR>EG:<BR><BR>If Session("CurrentURL") &#060;&#062; Request.ServerVariables("URL") Then<BR> Session("Counter") = Session("Counter") + 1<BR> Session("CurrentURL") = Request.ServerVariables("URL")<BR>End If

  4. #4
    Papa Zito Guest

    Default You threw me for a loop with that first post!

    I swear, I was staring at the screen for like 5 minutes trying to figure out how to get that to work. &#060;grin&#062;<BR><BR>This post did exactly what I wanted it to do. Too bad it only works once, but now that I have a starting point, I can probably go from there. Thanks for your help!

Posting Permissions

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