John LeschinskiiPhone Web-Development.

Now that you have your custom icon set up for iPhone users, here is another helpfull guide from the folks at apple to get you started on developing iPhone versions of your site. The guide has some examples on how to make content that are optimized for iPhone’s gesture-based, windowless environment.

With the iPhone accounting for larger and larger amounts of mobile browsing, despite being 2% of the smart phone market, it seems like a worth while endeavour.

But how to deliver the iPhone version too iPhone users? Browser detection, or more specifcly HTTP_USER_AGENT; this data, as well as IP address, OS, and the requested document are sent to the server.

Here is how to do this detection and content distrabution via a shell script.
Rather do it as a shell script? Me too. Here’s how I’d do that as a rudimentary Linux shell script:

#!/bin/sh

if [ ! -z "$(echo $HTTP_USER_AGENT | grep iPhone)" ] ; then
echo "Location: iphone.php"
else
echo "Location: index.php"
fi
exit 0

You can also have specific CSS information sent to diffrent user agents through if expresions.
#if expr="(${HTTP_USER_AGENT} = /iPhone/)"

iPhone styling

#else

defualt styling

#endif

John Leschinski Written by John Leschinski from Leschinski Design
Posted on February 16th, 2008 and filed under Design & Coding
Do not forget to subscribe to our RSS feed for updates
  • Digg This Post
  • Tweet This Post
  • Stumble This Post
  • Submit This Post To Delicious
  • Submit This Post To Reddit
  • Submit This Post To Mixx
  • BloggingTips Uses Aweber

5 Responses to “iPhone Web-Development.”

Author comments are in a darker gray color for you to easily identify the posts author in the comments

  1. Kate says:

    did you know where i can find full list of iPhone User-Agents ?

  2. That’s good but you must have a knowledge on php in order to do that.

  3. John Cow says:

    Yes knowledge indeed!

  4. Is this compatible with all current versions of the iphone?

  5. iphone girl says:

    I’ve got the latest model and it worked for me.

Trackbacks

Comments are closed.

Comments are closed since this post is older than 30 days. However, you can continue this discussion in our popular Blogging Forums

Subscribe To BloggingTips Via RSS Subscribe To Blogging Tips Via Email Follow Us On Twitter Follow us on Facebook Find Out More About Our Newsletter

Sponsors

Blogging Tips Newsletter

Webmaster Corner

 

Our Free E-Books

Site Partners