×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    3

    Browser/handset check

    HI there,

    Is just finished my first demo Xhtml site optimized for the Nokia 3650 handset but i would like to add some "checks" to my front page that check for the following things:

    1. is the browser XHTML compatible? if not then redirect to a normal WML page.
    2. what handset are trying to acess the page? 5100 etc.
    3. what screensize does the handset have? so i can use diffirent stylesheets for diffirent sizes.

    Can anybody help me out with this?

    THX
    Lars

  2. #2
    Registered User
    Join Date
    Nov 2003
    Posts
    16
    try this php script....

    <?
    $browser = $HTTP_USER_AGENT; //get browser type

    if (preg_match("/Mozilla.*/", $browser)) {//web browsers
    header("Location: page.html"); //go to html page
    }
    elseif (preg_match("/Symbian/", $browser)) { //N7650, N3650, etc
    header("Location: page.xhtml"); //go to xhtml page
    }
    else { //any other browser
    header("Location: page.wml"); //go to wml page
    }
    ?>
    i don't bother making color wml pages coz the screen is small and resolution is crap. just stick with wbmp.

  3. #3
    Registered User
    Join Date
    Sep 2003
    Posts
    3

    Thanks!

    Thanks nowanda!

    But does anyone have some asp or jsp code that can do the same?

    Thanks again!

    //Tabasco

  4. #4
    Registered User
    Join Date
    Nov 2003
    Posts
    16
    here's a better php script....

    <?
    if(preg_match("/xhtml/", $HTTP_ACCEPT)) {
    header("Location: page.xhtml");
    } elseif (preg_match("/wml/", $HTTP_ACCEPT)) {
    header("Location: page.wml");
    } else {
    header("Location: page.html");
    }
    ?>

    sorry, don't know .asp or .jsp equivalent of above script.

    good luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×