« Previous Next »

Thread: Create a server side alert

Last post 06-02-2006 9:18 AM by tomkmvp. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 06-01-2006, 4:41 PM

    • Goedele
    • Not Ranked
    • Joined on 06-01-2006, 8:11 PM
    • Posts 3

    Create a server side alert

    Hello all,

    I'm looking for a possible method to alert visitors (I'm talking about a Company intranet)who access any of the pages on our domain,  that if they access more than 3 pages they'll be charged.

    Some facts:

    We work with Frontpage 2003 on an W2K server with IIS 5.0

    The domain I would need this alert on looks something like: http://www.blahblah.blah.blah.com/blah/

    There are over 120 webfolders under the /blah/ folder, and each of them contains - at minimum - a hundred pages.

    What I would like to achieve is that, when a visitor arrives for the first time on any page under the root folder, he is alerted that he will be charged if he opens more than 3 pages that month.

    Obviously this alert should only show once to the visitor, not each time he opens a new page. In fact, once he has been presented with the alert, he should not be bothered with it ever again (as a matter of speaking ;)).

    Clientside scripting is not an option considering the high amount of pages. And since a lot of our visitors just come via a (deep)link through an email or such, we need the alert on all pages.

    Is there somebody who can provide me with information on how this can be implemented?

    Many thanks in advance! Cheers :)

    Goedele

  • 06-02-2006, 1:38 AM In reply to

    • thomad
    • Top 25 Contributor
    • Joined on 08-20-2002, 3:28 PM
    • Redmond
    • Posts 503

    Re: Create a server side alert

    Goedele,

    if the visitor is authenticated you can log each access - to a database for example. This is simple enough if the pages are dynamic (e.g. ASP or ASP.NET). If the user is not authenticated you can only use a cookie. The visitor can delete the cookie however.

    Hope this helps.

     

    Thomas Deml
    Program Manager
    Internet Information Services
    Microsoft Corp.
  • 06-02-2006, 4:24 AM In reply to

    • Goedele
    • Not Ranked
    • Joined on 06-01-2006, 8:11 PM
    • Posts 3

    Re: Create a server side alert

    Thomad,

     

    It will have to be the cookies then. 99% of the pages are html. Creating a database for user accounts is not an option yet, still, we need to have this alert available asap.

    So again, can you (or anyone else) point me to a piece of code / scripting that would trigger the alert for visitors that did not access our domain before - or visitors that deleted their cookies?

    Many thanks in advance :)

    Goedele

  • 06-02-2006, 9:18 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,163
    • IIS MVPs

    Re: Create a server side alert

    This is really the wrong forum for this (client-side scripting) but here you go (this is untested):

    http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/cookie.asp

    <script>
    function CheckCookie();
    {
    var myCookie = document.cookie.split("; ");
    for (var i=0; i < aCookie.length; i++)
      {
        var aCrumb = aCookie[i].split("=");
        if (aCrumb[1] == "Visited")
          return;
      }
    document.cookie = "Status=Visited; expires=Sat, 31 Dec 2006 23:59:59 GMT;";
    alert("You will be charged if you visit more than three times a month.");
    }

    CheckCookie;

    </script>

Page 1 of 1 (4 items)
Microsoft Communities