Page 1 of 1
Mobile/Cell Phone Question?
Posted: Fri Mar 03, 2006 7:28 pm
by Dale
Just a small question really... is there a way to determine if a user is viewing a page on there mobile/cell phone?? Like would the php tag that determines your browser be different?? Because I'm thinking about making some kind of IF statement for my website. Eg;
Code: Select all
<?php
if($browser_tag == "Mozilla/IE *whatever*") {
$images = "enabled";
} else {
// In mobile view
$images = "disabled";
}
?>
What would the result of that tag that returns the users browser most likely to be if they're viewing on a phone??
Posted: Fri Mar 03, 2006 9:33 pm
by anjanesh
The new phones - 3G ones - have xHMLT browser with thosands of colours, and good screen resolution - though not like the PC but most pages can be viewed in full. Its the internet connection thats expensive as its slow and therefore people tend to use WAP ot xHTML over WAP - inspite of having a device that can do a lot of multimedia.
If you tend to create a separate site for WAP / low-res based devices, you can have a separate link to it like wap.yourdomain.com or whatever.
Its difficult to check for a mobile-based browser as most have their own. Opera mobile is common though. You might want to check out
Nokia Browsing Tools.
I guess the faster way out is to check if its not PC-based IE, FF, Netscape, etc - and then do an else for non PC based browsers.
Do post if you get a solution.
Posted: Fri Mar 03, 2006 9:41 pm
by Dale
Cheers for the link, and yes I may take your advice and check for the "normal" online browsers. Because loading my site on a mobile phone could cost people loads! Due to the images.
Posted: Sat Mar 04, 2006 12:55 am
by darryladie
Are you using CSS to style your pages? If you are then use:
<link rel="stylesheet" src="style.css" media="handheld" />
<link rel="stylesheet" src="style.css" media="screen" />
If you wanna design for the PSP as well you need to check for user Agent: "Mozilla 3.0"
Darryl