How does the program written in server side scripting language works?
Server side scripts start processing data generally when end
user or client triggers some action. Server side looks for the
request object sent by end user and processes it and presents the
relevant data model.
For example a user wants to see his profile. He can click on the
Show Profile button after Login. Once he click it a request object
with two parameters Login Id and Profile is sent. The server side
processes the request and separates the Login Id and Show Profile.
It then ask the database or file to show profile associated with
the login id.
There are auto-loading classes and triggers which activate on
their own without user input also.