La Comunidad de Desarrolladores WAP
@ Contacta con nosotros
  .WMLClub


APRENDIZAJE
- Tutoriales
- Código fuente / Demos
- FAQS
- Configuración móviles
- Demos en WAP

HERRAMIENTAS
- Programas / Download
- Creación de contenidos

ARCHIVO
- FAQS
- Terminales WAP
- Documentos
- Artículos
- Noticias
- Links
- Libros
- Índice WAP

    CÓDIGO FUENTE/DEMOS

    CODIGO en PHP y PERL PARA IDENTIFICAR SI EL NAVEGADOR SOPORTA WML

    El siguiente codigo PHP y PERL, ayuda a detectar si el browser que se esta utilizando soporta el lenguaje WML. Al utilizar la funcion HTTP_ACCEPT (que contiene los formatos que soporta cada browser), los telefonos y disposivos PDA soportan y/o requieren el "text/vnd.wap.wml" mientras que los navegadores no. Si el navegador soporta "text/vnd.wap.wml" se va a la liga index.wml, y si no se desvia a main.php Este codigo es util para solo dar tu direccion de wap como http://futbolafondo.com/ y no http://www.futbolafondo.com/wap/index.wml que escribirlo en un cel seria un poco molesto =)
    Enviado por Juan Carlos Lopez, email Dragnovich@yahoo.com
    --- index.php ---
    

    <?php // Browser detection & router // By: Dragnovich@yahoo.com // ########################################### if(eregi("text/vnd.wap.wml",$HTTP_ACCEPT)) { // Si el Navegador soporta WML $url = "/wap/index.wml"; } else { $url = "/wap/main.php"; } header("Location: $url"); exit; ?>

    --- fin de index.php ---

    o se puede utilizar de la siguiente manera.

    --- index.php ---

    <?php // Browser detection & router // By: Dragnovich@yahoo.com // ########################################### if(eregi("text/vnd.wap.wml",$HTTP_ACCEPT)) { // Yes Browser is understand WML format header("Location: /wap/index.wml"); exit; } ?>

    <html> CODIGO HTML O PHP....... </html>

    --- fin de index.php ---

    En Perl se puede hacer la misma detección con la función...

    --- index.pl --- #/usr/bin/perl -w # Browser detection & router # By: Dragnovich@yahoo.com ########################################### if($ENV{"HTTP_ACCEPT"} =~ /text\/vnd\.wap\.wml/i) { $url = "index.wml"; } else { $url = "main.wml"; } print "Location: $url\n\n"; exit;

    --- END ---