cgm225 Posted August 10, 2008 Share Posted August 10, 2008 When someone visits my website... say Example.com, how do I direct people using blackberries, cell phones, pda's, etc, to a mobile version of the website, while sending the rest to the regular site? Or, should the regular site somehow be compatible with mobile web devices? I have read this but still need some help understanding how to code a webpage for mobile devices, and how to get those mobile devices directed to that webpage. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 10, 2008 Share Posted August 10, 2008 http://www.andymoore.info/php-to-detect-mobile-phones/ it might not be the best implementation, but it will give you some ideas. Quote Link to comment Share on other sites More sharing options...
ardyandkari Posted August 10, 2008 Share Posted August 10, 2008 i believe that there is a good way using css...dont remember how, but pretty sure it works. Quote Link to comment Share on other sites More sharing options...
corbin Posted August 11, 2008 Share Posted August 11, 2008 CSS? What? How would CSS redirect a user? Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted August 11, 2008 Share Posted August 11, 2008 CSS? What? How would CSS redirect a user? IE-only: * { background: expression(location.href='http://www.google.com'); } Yes, it does work. Quote Link to comment Share on other sites More sharing options...
ardyandkari Posted August 11, 2008 Share Posted August 11, 2008 information on styling for handhelds w3c site for mobile css refrence for handheld css now, please remember...i didnt take the time to really delve into these sites...if they dont help you, i'm sorry... Quote Link to comment Share on other sites More sharing options...
corbin Posted August 11, 2008 Share Posted August 11, 2008 So you could use a link tag with a mediatype="handheld" attr? Not redirection, but it would work. IE-only: * { background: expression(location.href='http://www.google.com'); } Yes, it does work. I knew there was some kind of JS type thing in CSS, but I didn't know that people actually used it. Guess the whole IE-only thing is why. Edit (Daniel0): Added real quotes. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted August 11, 2008 Share Posted August 11, 2008 Well, it's stupid and it can bring the browser to its knees. It will not just be evaluated when you load the page, but also when you resize the viewport, move your cursor and all sorts of things. Quote Link to comment Share on other sites More sharing options...
cgm225 Posted August 11, 2008 Author Share Posted August 11, 2008 So again, how should I be directing mobile users to a mobile home page? Quote Link to comment Share on other sites More sharing options...
corbin Posted August 11, 2008 Share Posted August 11, 2008 Well, it's stupid and it can bring the browser to its knees. It will not just be evaluated when you load the page, but also when you resize the viewport, move your cursor and all sorts of things. Really? That's gay. (P.S. I'm really bad about ghetto quoting things.... Bad habbit hehe.) So again, how should I be directing mobile users to a mobile home page? You could do the suggested by ardyandkari, although I'm not sure if all phones will work with that. Or, you could check the user-agent or something. Quote Link to comment Share on other sites More sharing options...
ardyandkari Posted August 11, 2008 Share Posted August 11, 2008 or you could just not worry about it...probably easier in the long run, besides...the iphone renders pages as is...i would think that will become more and more common in the future with phones... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.