Welcome to WebmasterWorld Guest from 54.197.75.176

Forum Moderators: bakedjake

Message Too Old, No Replies

Redirect a mobile/PDA to a "lite homepage"

full webpages kill smartphones i need to redirect them to a lite version

     
5:27 pm on Apr 25, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 25, 2004
posts:83
votes: 0


Redirecting a phone or pda to a lite version of a webpage using plain html,javascript or php

any surgestions?

5:50 am on May 12, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 31, 2004
posts:95
votes: 0


yes! use css. write once.use everywhere. that's all it takes!
1. your desktop web site must be liquid/elastic using the box model.
2. define your fonts in ems instead of points or pixels.
3. make images be backgrounds and use pure css mouseovers instead of images.
4. access earlier posts in this discussion group for information about importing styles, declaring media="handheld", and the right doctype.
5. also, use xhtml instead of html 4.0

ssvenson

5:45 pm on May 20, 2004 (gmt 0)

Inactive Member
Account Expired

 
 


I've done it...

In ASP though, so you will have to look up the appropriate commands in PHP to do the same (easy).

userAgent = Request.ServerVariables("HTTP_USER_AGENT")
userAgent = lcase(userAgent)

if Instr(userAgent, "mozilla") <= 0 then
if Instr(userAgent, "alcatel") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "ericsson") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "nokia") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "panasonic") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "phillips") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "samsung") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "sanyo") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "wml") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "up") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "mot") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "wap") then
Response.Redirect("/wml/index.asp")
elseif Instr(userAgent, "ppc") then
Response.Redirect("/ppc/index.asp")
elseif Instr(userAgent, "ce") then
Response.Redirect("/ppc/index.asp")
end if
end if

So basically you get the user agent from the client and parse the string... This works for everything I have so far, except for the ppc line, which I've seen a couple of glitches in...

Shaun

6:18 pm on May 20, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 25, 2004
posts:83
votes: 0


that great thanx 4 all ur help