Developing a site for computers and mobile devices

Hi everybody,
I’ve been asked to update some old sites so that they will work on mobile devices such as a blackberry or iphones etc. Is it possible to make a site so it works on all devices?

Does anybody have any advise on how I do this?

Thanks in advance.

I tend to say no, because the diversity of how devices handle the web is vastly different. My advice would be to have a separate mobile version of the site (much simplified) and then offer it to them somewhere on the main website - this would allow them to navigate using either the full featured version or the lightweight version, depending on which they prefer. Redirecting users or trying to use CSS to customize it based on their device or viewport size isn’t widely adopted.

This is the one of the worst things you can do, it’s up there with JavaScript resolution redirectors. Apart from the fact many mobile devices fake the user agent string to make them appear like desktop browsers, to successfully redirect people based on it would require over 250,000 string checks (that’s how many different mobile devices you would need to be looking up against) and you would be maintaining an extra 15 or so every week (to cater for new devices being released). You should NEVER force people to use what you dictate nor should you assume that you can simply select a few user agent strings and catch all the mobile device users. :slight_smile:

You could use $_SERVER[‘HTTP_USER_AGENT’] to check what the user is using then show the relevant files.