Detect correctly the device and pass to the other web application (php, ruby, perl ..... etc.) the capabilities as environment variables (AMFWURFLFilter)
If you want to know something about the world of mobile technology I have written this article, the only problem it's in Italian (if anyone have the patience to translate it is wellcome)