Another bullet point to add to NogDog's list (I'd put this just after the one mentioning get_browser):
Look in the request's http headers for an "Accept:" header, which would give the browser's preferences for how content should be served. text/html for HTML, text/vnd.wap.wml (if I remember right - I also remember a '.wmlc' for compressed WML) for WAP; pick and serve the one with the higher 'q' rating if both are present.
Oh, and if it comes up: put your foot down and insist that pixel-perfect layout will be totally infeasible. A design that works for 1280x1024 won't work for 256x256 - and vice versa. (The Web Developer extension for Firefox provides a "small screen rendering" options for getting a feel for small-screen constraints.)