Article Diary - General Knowledge Digest

PHP Code to Detect iPhone and iPad

Here is the PHP code to detect if a user is browsing your website from iPad or iPhone. If you want to detect iPad and iPhone browser then following snippet will help you to redirect users to new page specifically designed for iPhone or iPad devices.
PHP iPad Detection Code
if(strstr($_SERVER[’HTTP_USER_AGENT’],"iPad"))
{
header("Location: http://ipad.yourdomain.com");
}
?>
PHP iPhone Detection Code
if(strstr($_SERVER[’HTTP_USER_AGENT’],"iPhone"))
{
header("Location: http://iphone.yourdomain.com");
}
?>
Attached Files
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Name
Email
Security Code Security Code
Related Articles RSS Feed
Microsoft Outlook 2002 and Outlook 2003: Resetting Microsoft Outlook's 'nickname cache'
Viewed 1282 times since Sat, Mar 27, 2010
how to use LDAPsearch
Viewed 1036 times since Fri, Jan 15, 2010
Increase Your Internet Speed Instantly
Viewed 975 times since Mon, Feb 15, 2010
Google Caffeine Search Update
Viewed 2049 times since Wed, Nov 11, 2009
How do I add and register extra domain names?
Viewed 2734 times since Fri, Oct 9, 2009
Windows 7 Secret God Mode
Viewed 1013 times since Fri, Feb 26, 2010
Article Templates
Viewed 973 times since Sat, Jan 2, 2010
RiverStar Studio - Testing List Items
Viewed 974 times since Wed, Aug 11, 2010
File Upload in PHP - PHP File Upload Script
Viewed 1808 times since Thu, Nov 5, 2009
MENU