| Reply | « Previous Thread | Next Thread » |
|
hi all
i need any script that can detect the browser type of a mobile device and redirect it to WML or XHTML thanx |
|
There are many ways of doing this - what scripting language are you using?
If you are using PHP, then take a look at this - it can be modified quite easily to check for WML too. IF you are nice, and show some effort as to how you have gone about this task, then I may even post a link to the code I use (PHP) ![]() Cheers, Jamie # Any form of employment is strictly prohibited ...... |
|
Google for WURFL
|
|
Hi,
Browser can be detected by many ways but i would like to tell you the way which i use to store which mobile visit my wap site. Browser can be detected with Java but java with wml wont be easy so i would suggest you to use Server Side Lang. like PHP, ASP or Asp.net. You can use wml scripts in ASP like i do. ASP: <% Response.ContentType = "text/vnd.wap.wml" %> <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <head> <meta http-equiv="Cache-Control" content="max-age=0" forua="true" /> </head> <card id="LG" title="wap.bluemobiles.com"> <% Set bc = Server.CreateObject("MSWC.BrowserType") %> Your Browser is : <%= bc.browser %> Version is : <%= bc.version %> </card> </wml> Save as the above script ".asp" upload to you site and visit thourgh your mobile it will show off the browser headers shnawer bluemobiles.com |
|
the last time i mentioned a script that use a component.
if it dosnt work with you then use this <% If Instr(Request.ServerVariables("HTTP_USER_AGENT"),"Nokia") Then Response.Redirect "nokia.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"MOT-") Then Response.Redirect "motorola.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"Panasonic") Then Response.Redirect "panasonic.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"SAMSUNG-SGH-") Then Response.Redirect "samsung.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"SIE-") Then Response.Redirect "siemens.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"SonyEricsson") Then Response.Redirect "sonye.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"NEC-") Then Response.Redirect "nec.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"SHARP") Then Response.Redirect "sharp.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"LG") Then Response.Redirect "lg.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") Then Response.Redirect "../wapinfo.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"Netscape") Then Response.Redirect "../wapinfo.asp" elseIf Instr(Request.ServerVariables("HTTP_USER_AGENT"),"Opera") Then Response.Redirect "../wapinfo.asp" else %> <% Response.ContentType = "text/vnd.wap.wml" %> <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <head> <meta http-equiv="Cache-Control" content="max-age=0" forua="true" /> </head> <card id="Default.asp" title="wap.bluemobiles.com"> <p align="center"> <img src="../blueimages/waplogo.gif"/><br/></p> <p align="left"><b>Welcome!, Menu</b><br/></p> <a href="midi.asp">Midi Tones</a><br/> <a href="mmf.asp">MMF (SMAF) Tones</a><br/> <a href="imy.asp">I-Melodies</a><br/> <a href="sendemail.asp">Send Email</a><br/> <a href="wallpapers.asp">Wallpapers</a><br/> <small>Sorry! Your Phone is not supported. But you still can use few options If you are know your phone support them</small> </card> </wml> <% End If %> save it as default.asp and visit thourgh different mobile it will aumatically detect the mobile and will redirect to the concerned page shnawer bluemobiles.com |
|
Hi,
I'm trying to develop a wap & xhtml version of my photography site www.christopherholt.com - I'm more photographer than developer, so am trying hard! The xhtml is in www.christopherholt.com/mobile/index.htm The wml is in www.christophehrolt.com/mobile/index.wml My problem had been how to get the phone to choose the wml or xhtml automatically, & I guess the ASP/PHP file would sort that out. Where would I put this though? Does it go in the actual xhtml & wml cards/files or does it sit on it's own in the root folder? Thanks for any help, whatsoever. Why isn't this stuff in the Nokia manuals btw?!
Last edited by cmholt2002 : 2005-11-30 at 14:54.
Reason: xhtml & wml links
|
| cmholt2002 |
| View Public Profile |
| Find all posts by cmholt2002 |
|
I'm more designer than developer. Welcome to visit my page.
XHTML WAP: http://www.nowinlove.com/wap HTML: http://www.nowinlove.com Sorry for all, the version is for TC. SC and EN version is coming soon. ![]() |
|
It is very hard to say. Although you detected the browser, but how can you control the screen width? I can just say, it is a trouble.
Truly, my experience told me. Detect browser for internal use only is okay. Nothing can be proved. At my side, I choose to let visitors select the screen width if first visit. ![]() |
|
Hi,
I'm implementing in Java. I have come accross similar problem. How to detect what version of WAP ( 1.0 or 2.0 ) does the browser handle? I know that with USER-AGENT header I may get the type of a browser. I wonder if there are some lists of browsers where it is pointed out which version of WAP does the browser handle. Thanks for help rypki |
|
For compatibity chart see some info at http://www.thewirelessfaq.com/5.2.asp
___________________ eDIY New Zealand NZ Web hosting Website Design and eCommerce CMS Software
Last edited by mikeyg11 : 2006-01-18 at 11:56.
|
|
I need help and I too need help with browser detection but not for asp but for php and for a website...
I am looking for a browser detection software that not only is written in php/or javascript but that also detects os (operating system) as well asd adjusts the website (height/width) to fit a standardize 600*800 screen resolution. I mentioned php because the site that I am working on for m company is on a linux server. http://www.evirtualworld.com/webdesi...and-design.php the main problem is that the style sheet doesnt work in opera or on a mac when viewed with Netscape browser...I would rather use .php file as opposed to javacript since that could cause some server site issues (some js is not supported across different browsers). Any suggestions? Robert |
|
Hi Robert,
You better don't want the CSS will work on all Mobile browsers. Actually, no standard in the mobile world. Pls forget it, use normal text to handle non-CSS browsers. Cheers!! Vincent |
|
Quote:
request.ServerVariables("HTTP_ACCEPT") to detect the browser support xhtml / wml. (for mobile only) String will return like the followings: (example of N6230) application/vnd.wap.wmlscriptc, text/vnd.wap.wml,application/vnd.wap.xhtml+xml, application/xhtml+xml,text/html,multipart/mixed, */*, text/vnd.wap.wmlscript Vincent |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| How To Launch Application From WAP Browser When Browser URL Invoked | bhuvnesh1234 | General Browsing | 3 | 2008-11-21 19:57 |
| Do nokia mobile browser like other browser IE or opera support CGI function?...@@. | mikeliu1976 | Browsing and Mark-ups | 1 | 2005-03-10 12:59 |
| Web browser as a control in my C++ App | natocm | Symbian User Interface | 0 | 2004-03-03 17:38 |
| localhost support in 3650 WAP browser? | hansomaier | General Symbian C++ | 1 | 2004-01-13 12:09 |
| Browser ver. vs WAP version | lhm22 | General Browsing | 0 | 2003-07-24 20:33 |