Dynamic web pages can be created with almost any (scripting) language, as long as the web server allows you to execute the files. Most prevalent at the moment is PHP, but there's also Perl, Python, Ruby, Bash, Smalltalk, LISP, ...
If you want an example of how to write something like this take a look at
a blog engine written in bash.