» Design & Coding » iPhone Web-Development.

John LeschinskiiPhone Web-Development.

Written by John Leschinski from Leschinski Design on February 16, 2008

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

Written by John Leschinski from Leschinski Design on February 16, 2008 | Filed Under Design & Coding

Share with others

  • StumbleUpon
  • Add to Delicious
  • Mixx
Make money with LinkXL

5 Responses so far | Have Your Say!

  1. Kate  |  March 3rd, 2008 at 5:18 am #

    Kate - Gravatar

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

  2. activate apple otb iphone  |  April 30th, 2008 at 2:00 am #

    activate apple otb iphone - Gravatar

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

  3. John Cow  |  July 24th, 2008 at 3:22 pm #

    John Cow - Gravatar

    Yes knowledge indeed!

  4. Web Design Zoo  |  August 8th, 2008 at 4:14 am #

    Web Design Zoo - Gravatar

    Is this compatible with all current versions of the iphone?

  5. iphone girl  |  August 28th, 2008 at 9:45 pm #

    iphone girl - Gravatar

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

Trackbacks to 'iPhone Web-Development.'

Leave Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>