473,748 Members | 8,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server Side Scripting for Mobile Detection and Redirection

9 New Member
Hi all...

I need some help figuring out what sort of script is needed to first: detect if a viewer is coming from a mobile device and second: if so, redirect the viewer to the mobile site.

IIS Server
home site: site.com
mobile site: site.com/mobile

I have researched and found code to implement... but it was for an .htaccess file for use on APACHE.


Thanks in advance...
May 15 '07 #1
8 16997
kestrel
1,071 Recognized Expert Top Contributor
What server-side scripting language are you using? ASP right?

i don't know much about server-side anything beyond knowing its done by the server, but i know browser detection and redirection is possible. How this is done and used i do not know.
May 15 '07 #2
quushich
9 New Member
Yes... ASP.
May 16 '07 #3
kestrel
1,071 Recognized Expert Top Contributor
You would get a better answer in the ASP forum. The experts and mods there have a better understanding ASP and they would be happy to point you in the right direction.
May 16 '07 #4
theoriginals
8 New Member
I think you need WURFL on sourceforge dot net.

You can implement the code using several different languages (php,asp, and Java) but you're going to need a bit of programming skill to do much with it ;)

The information as to what is looking at pages on your server is sent via a http header (think this is the correct term), the browser and device information is contained in something called the 'User Agent', the type of files that the browser can handle is sent in the 'Accept' header.

Have a go browsing some of these terms and see how you get on.

I'm no expert but I've found php a good language to work in, maybe you should give that a go.

Matthew
May 18 '07 #5
kestrel
1,071 Recognized Expert Top Contributor
i think IIS only uses aspm correct?
May 18 '07 #6
quushich
9 New Member
Here is what we have so far... placed in the head of the original index.html file:

<%
userAgent = Request.ServerV ariables("HTTP_ USER_AGENT")
isMobile = false
if((InStr(userA gent, "AvantGo") > 0) OR (InStr(userAgen t, "Windows CE") > 0) OR (InStr(userAgen t, "NetFront") > 0) OR (InStr(userAgen t, "BlackBerry ") > 0) ) then
isMobile = true
end if
if isMobile then
response.redire ct("http://www.namesandnum bers.com/mobile")
end if
%>

Seems to be doing the trick... just had to save the index.html file to an index.asp file and then had the server point to the .asp as priority.

We will then add any other "mobile" users to the list above for detection...
May 22 '07 #7
theoriginals
8 New Member
Good start, but you're going to need a much bigger database of devices if you want to capture any meaningful proportion of people. For example here's the user agent for a Nokia N73:

NokiaN73-1/3.0704.1.0.1 Series60/3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1

And the same N73 with Opera Mini:
Opera/8.01 (J2ME/MIDP; Opera Mini/3.1.7196/1630; en; U; ssr)

Also, there are a bunch of devices that depending on what you're looking for could appear to be a web browser (MSIE).

For example the Palm Treo 180:
Mozilla/1.22 (compatible; MSIE 5.01; PalmOS 3.0) EudoraWeb 2.1

Seems that there is very little standardization as to what a user agent needs to communicate, so for now the best thing I've found was the WURFL database.

Matthew
May 23 '07 #8
Plater
7,872 Recognized Expert Expert
Hi all...

I need some help figuring out what sort of script is needed to first: detect if a viewer is coming from a mobile device and second: if so, redirect the viewer to the mobile site.
The headers sent from a "cell phone" internet browser contain different values.
Check things like "Accept-Encoding" (is usually gzip or some form of compression) and "Accept-Type" will contain different types also it should ID itself as to what browser it is (MWAVE or something).
Jun 15 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2574
by: Matt | last post by:
I think this is the basic concept in ASP server-side development. My boss told me web application is NOT client-server application. I argued with him because browser is the client, and the server code put in server. Then web application should be a client-server application. My understanding is that a web application is an application that runs on a browser. But client-server application is not necessary a web application. Please...
21
1815
by: Agoston Bejo | last post by:
Hi, I would like to achieve the equivalent of META REFRESH but without the HTML meta refresh and without JavaScript. In other words, on server side I would like to wait some seconds, then redirect the page. Is there any way to do this?
4
6235
by: Jim Hammond | last post by:
After much effort, it doesn't seem possible to redirect the user to a new page after 10 seconds by using a server-side timer. I am now using the following meta statement to accomplish the same thing: <META HTTP-EQUIV="refresh" content="10;URL=Form_Welcome.aspx"> This seems to work fine, but I now have three concerns because I thought it was supposed to be possible to do everything in C#. 1. Note that Visual Studio lets the developer...
3
1693
by: Ohad Young | last post by:
Hi, I have a frameset page that contains two frames: 1. the first frame, an aspx page, contains a menu for navigating in the website. 2. the second frame contains content, pdf, html or other aspx files The problem is that the menu activates a server-side methods when the user clicks on one of the menu items. However, from the server side I cannot control in which frame the content will appears, it will always be in the menu frame...
0
1514
by: Carlos | last post by:
Hi all, I am currently able to detect the browser capabilities, and determine if a browser is from a mobile device. However, I only have been able to place this detection code in an aspx page. In other words, if I want the detection to take place in my home page, I do NOT know how to do it. i.e. www.myhome.com. However, I am able to do it at : www.myhome.com/browserdetection.aspx. I can mention www.davesipaq.com as example. Can...
3
2992
by: quushich | last post by:
Hi all... I need some help figuring out what sort of script is needed to first: detect if a viewer is coming from a mobile device and second: if so, redirect the viewer to the mobile site. IIS Server home site: site.com mobile site: site.com/mobile I have researched and found code to implement... but it was for an .htaccess file for use on APACHE.
5
13123
by: Ankur | last post by:
Hi Folks, I am new for this group. I want to clarify one thing what's a basic difference between Client Side Java Script and Server Side Java Script. how we can differentiate it. Why we called this kind of script "Server Side Java Script". I am in confusion because according to lots of web developer Java Script is a client side scripting language. We can not say it Server Side Java Script.
1
3008
by: Sleepwalker | last post by:
Hi, I'm currently in the process of constructing a stripped down version of the company website that will be show to people logging in from a mobile device. When the user logs in to the homepage, he or she is directed to the homepage default.aspx, where they can login. As part of the Page_Load of this page, I added a check if the Request.Browser.IsMobileDevice, and in that case redirected to the custom mobile login page:...
22
2941
by: Dan Rumney | last post by:
Hi all, I've been writing Javascript for quite a while now and have, of late, been writing quite a lot of AJAX and AJAX-related code. In the main, my dynamically generated pages are created using Perl on the backend, with Javascript providing limited frontend functionality. As an example, an expanding tree would be fully populated on the server-side and then presented to the browser, with Javascript and CSS being used to vary the...
1
2787
by: jeremybwilson | last post by:
Can anyone give a JSP equivalent of the Request.ServerVariable example above? I am on an OpenCMS 6 system and trying to detect for Windows Mobile and redirect accordingly. I suppose I could just develop and HTML page and a separate CSS file with a media="handheld" attribute and use JavaScript to dynamically serve the CSS file but I'm reading a lot of forums that say JavaScript is a dicey proposition at best on many handheld clients.
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.