Recommended: ASP Application Object Tutorial The ASP Application object is a specific ASPApplication program used to share information between all users. All ASP files are in a virtual directory in IIS part of the same ASPApplication program. The Application.Contents collection contains all items, and also adds commands for ASPApplication objects and ASP scripts. The Application.Sta
Just copy the code table to a text file and save it in the website (/Global.asa) in the home directory.
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
application(activevisitors)=0
End Sub
Sub Application_OnEnd
End Sub
Sub Session_OnStart
application.lock
application(activevisitors)=application(activevisitors)+1
application.unlock
End Sub
Sub Session_OnEnd
application.lock
application(activevisitors)=application(activevisitors)-1
application.unlock
End Sub
</SCRIPT>
The first time visitors enter our page, Global.asa will be executed, so Application (activevisitors) will get a value equal to 0 on line 4. Immediately (as a new meeting has begun), on Line 12, Application (activevisitors) will be added by 1. Whenever a new visitor enters our page Application (activevisitors) will add one, the same, after each meeting, this parameter will be reduced by one (line 18).
In case we want to display the number of visitors on our page, we have to use this code:
Add the following to the asp page. The current number of people online <% = application(activevisitors) %> people.
Share: ASP request.from tutorial Changing our HTML form When we start creating a new ASP file, we want to change our tizagForm.html file to use the POST method and form to transfer data to different ASP pages. The following example provides the latest codename tizagForm.html. form method=POST action=tizagPost.asp Name input type=text name=Name/ Age