I use this little script to detect what browser is being used by the visitor. Is it web browser or WAP browser. Yes, I want my domain accessible by two kind of browser and redirect them to the specific page (ie. web or WAP).
So if visitor open my homepage using web browser (Opera, Firefox, Safari, Internet Explorer, Kameleon, Konqueror, Flock, etc), he will be brought to a web page. Otherwise, if he open my homepage using WAP browser (browser on cellular phone), he will be redirected into a specific page designed for tiny screen.
Here is the script, I write as index.php and put it in the root directory of my homepage. It might be public_html, www, htdocs or whatever it named.
For your information, directory wap/ is place for my WML scripts and web/ is place for my HTML and PHP scripts.