Well I don't know if I am going to get much response to this, but I am going to add stuff I know, just in case anybody does a search later and hopefully this info will save them some grief...
The system I have wrote is in PHP, and output is determined on :
if(strpos($_SERVER['HTTP_ACCEPT'],"application/vnd.wap.xhtml+xml")){
// display xhtml code
}else{
// display wml code
}
Headers I send
// send wml headers
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
//echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
// . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.3//EN\" \"http://www.wapforum.org/DTD/wml13.dtd\">\n";
// send XHTML headers
header("Content-type: application/vnd.wap.xhtml+xml");
echo "<?xml version=\"1.0\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\n";
echo "\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
Nokia 7250i
HTTP_USER_AGENT = Nokia7250I/1.0 (3.22) Profile/MIDP-1.0 Configuration/CLDC-1.0
HTTP_ACCEPT = text/css, text/html, application/vnd.wap.xhtml+xml, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/vnd.wap.wbxml, application/xhtml+xml, application/wml+xml, application/vnd.wap.xhtml+xml, application/x-wap-prov.browser-settings, application/x-nokia.settings, text/x-vcard, text/x-vcalendar, application/vnd.wap.wtls-ca-certificate, application/vnd.wap.hashed-certificate, application/vnd.wap.signed-certificate, application/vnd.wap.cert-response, application/vnd.wap.sic, application/vnd.wap.slc, application/x-wap-prov.browser-bookmarks, text/x-co-desc, application/vnd.oma.drm.message, image/gif, image/jpeg, image/jpg, image/bmp, image/png, image/vnd.wap.wbmp, image/vnd.nok-wallpaper, image/vnd-nok-camera-snap, image/vnd-nok-camera-snsp, application/vnd.wap.mms-message, text/vnd.sun.j2me.app-descriptor, application/vnd.nokia.ringing-tone, audio/midi, audio/mid, audio/x-midi, audio/x-mid, audio/sp-midi, application/java, image/vnd.nok-oplogo-color, application/java-archive, application/x-java-archive, text/vnd.wap.wml, text/vnd.wap.wmlscript, */*;q=0.001
(Added spaces to not break tables)
Sony Ericsson K750i
HTTP_USER_AGENT = SonyEricssonK750i/R1L Browser/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1
HTTP_ACCEPT = image/gif, application/vnd.wap.multipart.mixed, multipart/mixed, application/xhtml+xml, application/vnd.wap.wml, application/vnd.wap.xhtml+xml, text/vnd.wap.wml, text/vnd.wap.wmlscript, */*;q=0.001
(Added spaces to not break tables)
Blackberry
HTTP_USER_AGENT = BlackBerry7290/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/5.1.2.5
HTTP_ACCEPT = application/vnd.rim.html, text/html, text/plain, application/xhtml+xml, application/vnd.wap.xhtml+xml, application/vnd.wap.wml+xml, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, image/gif;anim=1, image/jpg, image/vnd.wap.wbmp, image/png, image/vnd.rim.png, image/jpeg, image/pjpeg, application/smil, application/x-vnd.rim.pme, application/x-vnd.rim.pme.b, image/pme, application/vnd.oma.drm.message, audio/midi, audio/x-midi, audio/mid, application/x-javascript, application/vnd.rim.jscriptc;v=0-8-8, text/css;media=handheld, application/vnd.wap.multipart.mixed, application/vnd.wap.multipart.alternative, application/vnd.wap.multipart.related, multipart/mixed, multipart/alternative, multipart/related, text/vnd.sun.j2me.app-descriptor, application/java-archive, application/vnd.rim.proxyconfig, application/vnd.wap.coc, application/vnd.wap.slc, application/vnd.wap.sic, text/vnd.wap.co, text/vnd.wap.sl, text/vnd.wap.si, application/x-x509-ca-cert, application/x-x509-email-cert, application/x-x509-server-cert, application/x-x509-user-cert, application/vnd.wap.signed-certificate, application/vnd.wap.cert-response, application/vnd.wap.wtls-ca-certificate, image/bmp, image/vnd.wap.wbmp, text/x-wap.wml, text/vnd.wap.wml, text/x-hdml, text/html, text/vnd.wap.wmlscript, text/vnd.wap.co, text/vnd.wap.si, text/vnd.wap.sl, */*
1 comment:
Thanks for this !
Im busy designing a rich site that will support only XHTML phones. If the phone browser does not support XHTML MP then we are going to display an error to the user.
Do you think a derivative of this will work ?
Post a Comment