0

Hello all,

I have been trying to create a mobile version of my website but i haven't found any way yet.Is there anyone here that knows how to do it.If yes please let me know.

My email is <EAMIL SNIPPED>
Thank you.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by almostbob
0

the mobile version, of my site is at the subdomain m.mysite.com
this codescrap first in www mysite.com/index.php redirects

<?php $mobile = "http://m.mysite.com/";
if(preg_match('/Windows CE/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/Blackberry/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/Palm/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/SymbianOS/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/Opera Mini/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/Nokia/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/Samsung/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/vodaphone/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/Jphone/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/AvantGo/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/DoCoMo/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");}
elseif(preg_match('/DDIPOCKET/i',$_SERVER['HTTP_USER_AGENT'])) { header("location: $mobile");} 
/* redirect to pda page else continue */ ? >

the code can be better, but it works now

m.mysite.com mirrors www mysite.com but has shortened text descriptions(click for full text), iconized images, to keep each page very small ($/KB), and make the page faster in handhelds.
it is vital to use relative sizes ems,% in a mobile page, the browser rendering differences between palm/blackberry make firefox/IE a piece of cake

www.opera.com/mini/ has an emulator you can test your mobile site on

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.