Global Application

Results 1 to 2 of 2

Thread: Global Application

  1. #1
    Swift Guest

    Default Global Application

    Hi,<BR>I have members section on my website.<BR>I want to display members names on the site so other members can see who else is there.<BR>How can I use the genarated session varible when they login to display there name at the global level?<BR><BR>Thanks Swift

  2. #2 Guest

    Default RE: Global Application

    try this in your global.asa<BR><BR>sub Application_OnStart<BR> Application("strMember") = ""<BR>end sub<BR><BR>sub Session_Onstart<BR><BR>end Sub<BR>sub Session_OnEnd<BR> Dim regEx, str1 , replStr &#039; Create variables.<BR> str1 = Application("strMember")<BR> Set regEx = New RegExp &#039; Create regular expression.<BR> regEx.Pattern = trim(Session("strLoginName")& ";")&#039; Set pattern.<BR> regEx.IgnoreCase = True &#039; Make case insensitive.<BR> replStr = ""<BR> &#039;Lock Application level variable<BR> Application("strMember") = regEx.Replace(str1, replStr)<BR> &#039;Unlock<BR>end sub<BR><BR><BR>in your asp file, try the following stub<BR><BR>&#060;%<BR> strMember = trim(Application("strMember"))<BR> &#039;split it<BR> strMemberArr = split(strMember,";", -1, 1)<BR> for i = 0 to ubound(strMemberArr) - 1<BR> &#039; apply some HTML makeup here<BR> response.write strMemberArr(i)<BR> next<BR><BR>%&#062;<BR><BR>&#039;somewhere is your login verification page insert the following code<BR>&#060;%<BR>Session("strLoginName") = &#060;assign user login name string upon success login here&#062;<BR>&#039;please apply application level variable lock mechanism here<BR> Application("strMember") = Application("strMember") & trim(Session("strLoginName") & ";")<BR>&#039; dont forget to unlock<BR>%&#062;

Posting Permissions

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