Are you doing the same page for both devices? A common practice is to make two separate pages that are optimized for both devices, which by their nature have different shapes and characteristics.
so the code along the lines
$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 customizing the iPhone, there are quite a few iPhone frameworks, see here for a list around which development will be accelerated, and if you are developing on a Mac with Snow Leopard and the latest SDK, and now there is a built-in project in dashcode to create it.
source
share