ASP (Active Server Pages) can in the same way PHP can, be used to make WML contents dynamic. For some great examples on how to do this, check out Luca Passani's WAP and ASP articles.
Also check Jean-Luc Praz's many ASP driven examples at http://www.corobori.com/wap/.