In web pages they are called scripts.
Depending on what programming language you use to do this the specifics will vary, but its certainly possible.
PHP, ASP, ColdFusion etc...
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.