You Are Here:

Community: Developer Discussion Boards

#1 Old Browser detection - 2005-10-12, 13:58

Join Date: Oct 2005
Posts: 2
dodo562
Offline
Registered User
hi all
i need any script that can detect the browser type of a mobile device and redirect it to WML or XHTML

thanx
Reply With Quote

#2 Old Re: Browser detection - 2005-10-17, 05:02

Join Date: Jun 2004
Posts: 36
Location: HEL
Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Skype™ to jabba_29
jabba_29
Offline
Registered User
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 ......
Reply With Quote

#3 Old Re: Browser detection - 2005-10-17, 10:29

Join Date: Jan 2004
Posts: 3
jevgen
Offline
Registered User
Google for WURFL
Reply With Quote

#4 Old Re: Browser detection - 2005-10-21, 12:23

Join Date: Oct 2005
Posts: 11
shnawer
Offline
Registered User
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
Reply With Quote

#5 Old Re: Browser detection - 2005-10-21, 12:47

Join Date: Oct 2005
Posts: 11
shnawer
Offline
Registered User
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
Reply With Quote

#6 Old Exclamation Re: Browser detection - 2005-11-30, 14:50

Join Date: Nov 2005
Posts: 1
cmholt2002
Offline
Registered User
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
Reply With Quote

#7 Old Re: Browser detection - 2005-12-03, 05:04

Join Date: Jun 2004
Posts: 59
Location: Hong Kong
vincentckk's Avatar
vincentckk
Offline
XHTML
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.
Reply With Quote

#8 Old Re: Browser detection - 2005-12-03, 05:10

Join Date: Jun 2004
Posts: 59
Location: Hong Kong
vincentckk's Avatar
vincentckk
Offline
XHTML
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.
Reply With Quote

#9 Old Re: Browser detection - 2005-12-19, 17:37

Join Date: May 2005
Posts: 2
rypki
Offline
Registered User
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
Reply With Quote

#10 Old Re: Browser detection - 2006-01-18, 11:50

Join Date: Jan 2006
Posts: 4
mikeyg11
Offline
Registered User
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.
Reply With Quote

#11 Old Smile Re: Browser detection - 2006-01-29, 05:07

Join Date: Jan 2006
Posts: 1
robmaag
Offline
Registered User
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
Reply With Quote

#12 Old Re: Browser detection - 2006-02-02, 02:10

Join Date: Jun 2004
Posts: 59
Location: Hong Kong
vincentckk's Avatar
vincentckk
Offline
XHTML
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
Reply With Quote

#13 Old Smile Re: Browser detection - 2006-02-02, 02:27

Join Date: Jun 2004
Posts: 59
Location: Hong Kong
vincentckk's Avatar
vincentckk
Offline
XHTML
Quote:
Originally Posted by cmholt2002
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?!
Try to use:
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia