You need a server side script and a server that supports it. The most popular and wide spread is PHP but for this task an alternative is Server Side Includes (SSI), too. Both scripts (Server Side Includes
; PHP include()
) are equally simple to apply and both require your main documents’ file extension to be changed to .sht, .shtm, or .shtml (for SSI), or .php (for PHP), respectively, in order for the server to know how to treat the include statements.