server side languages come in all varieties. however, the precursor to using a server side language is determining what your host supports. for example, commonly used server side languages are:
what server side means essentially is that code is run on the server (therefore invisible to the client) which can perform special actions that the client (generally) cannot interfere with.
so in the case of password protection, the client sends the server info, and the server checks it behind the scenes with no way for the client to try and peek to see whats going on. then the server does something (deny/allow) based on the information the client sent.
so once you find out IF your host supports a server side language, then you go to the appropriate form and post your question there. they can then give you the code that youd "paste into a webpage".