You need to interact with a database, flat file or something like that, most people here will recommend PHP because its an easy server side language to get to grips with.
Use MySQL if you are going to have a lot of comments across a lot of pages, if you only have 1 or 2 pages, and you dont expect to get a lot of comments, use a flat file, (or an XML document)