just use a header redirection.
Its hard to distinguish if the user is using a mobile phone because of all the makes, models and different browsers.
You can try checking for Mozilla, windows or linux/unix in the user agent e.g.
<?php
//this would probably be best suited in a index.php page
if(!eregi("mozilla",$_SERVER['HTTP_USER_AGENT']) OR !eregi("linux",$_SERVER['HTTP_USER_AGENT']) or !eregi("windows",$_SERVER['HTTP_USER_AGENT']) OR !eregi("mac",$_SERVER['HTTP_USER_AGENT']) OR !eregi("unix",$_SERVER['HTTP_USER_AGENT']))
{
header("Location: http://www.yoursite.com/wap.wml");
exit;
}else{
//redirect to your html or continue with your page
}
?>
Note that opera and windows are now on mobile phones so the above redirection will not work that well.
Also you can just merge the above eregi's into one. I ripped that from a script I wrote 2 years ago.
Sorry if thats not the answer your looking for. Its really hard to understand you.