Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

creating a webpage for iphone

i am creating a web page for iphone, i need the page to display efficiently in the iphone as well as on pc's. I'm coding in xhtml and uses support of JavaScript and css. The problem is that, i'm getting the correct view in the pc's but too small in the phone.how to adjust the size of the page. I am checking the user agent and loading a separate page (other than one for the pc) for the iphone. But i dont know hat changes are to be made to the attributes of body, inputs and other things so as to enable it to view correctly on the mobile browsers also

like image 239
Nithin Avatar asked Oct 14 '22 11:10

Nithin


2 Answers

Are you making the same page for both devices? Usual practice is to make two separate pages that are optimised for both devices which by their nature have different form actors and characteristics.

so code along the lines of

$browser = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
if ($browser == true)  { header('Location: http://www.yoursite.com/iphone/'); }
//else{echo 'just carry on';}

In terms of setting up the iPhone there are quite a few iPhone frameworks see here for list around which will speed the development and if you are developing on a Mac with Snow Leopard and the latest SDK then there is now a built-in project in dashcode to produce one.

like image 73
PurplePilot Avatar answered Oct 30 '22 16:10

PurplePilot


I don't know if this is helping you know as you already started to develop your page. But this kit is the ultimate kit for IPhone web as far as i know. Check it out.

iWebKit

like image 27
Arto Uusikangas Avatar answered Oct 30 '22 16:10

Arto Uusikangas