this code switches the variable that stores the name of the skin the user (guest) will see on your page.
the above expression is more like a "switch" for 2 possible values IF the user enters via m.example.com.
it can be either "wap_skin" or "normal_skin"
with knowing that i would asume it dont works for you because you simply
dont have 2 skins with the names "wap_skin" and "normal_skin".
sooo.. you need to have 2 skins. one that is optimiced for the use with mobile devices and
one that is layouted to fit regular machines. then you would need to setup the correct names replace wap_skin with the name of the skin optimced for the mobile use and normal_skin with the name of the skin you normaly want to use. Dont forget to change m.example.com to your desired adress.
Koradhil's solution was to use that little framework for detecting if its a mobile device or not. with that and a little plugin you could do a simple autodetection.
the plugin would be only a few lines of code and pretty simple since you really only need to have 2 lines for detection and 1 line more for changing the skin variable.