PureNews

PureNews is an amazingly sleek and powerful news theme with unlimited color variations.

View full feature list Check out the live demo Buy this theme today

iPhone Web-Development.

Posted by on 16th Feb 2008 Design & Coding 5 comments

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 is the creative director and founder of Leschinski Design. John's skill and talent is sought after by large and small companies and organizations, both local to the Rainy River district, London Ontario, and globaly. His experience and knowledge are also used in classrooms to groom the next generation of web developers and business seminars discussing e-commerce and the value of good design.

5 comments - Leave a reply
  • Posted by Kate on 3rd Mar 2008

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

  • Posted by activate apple otb i on 29th Apr 2008

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

  • Posted by John Cow on 24th Jul 2008

    Yes knowledge indeed!

  • Posted by Web Design Zoo on 8th Aug 2008

    Is this compatible with all current versions of the iphone?

  • Posted by iphone girl on 28th Aug 2008

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