Microsoft
Software
Hardware
Network
Question : iPhone page redirect
I have an index page that contains a Flash intro but I want iPhone users to be able to skip this page and take them straight into the main site. I have tried various Javascript examples which worked, but then realised most iPhones don't have Javascript turned on. So I'm now looking at PHP solutions.
The code I'm dropping into my php page is:
<?php
if(strstr($_SERVER['HTTP_U
SER_AGENT'
],'iPhone'
) || strstr($_SERVER['HTTP_USER
_AGENT'],'
iPod'))
{
header('Location: about.html');
exit();
}
?>
This is taken from -
http://davidwalsh.name/det
ect-iphone
However it doesn't seem to be working.
Can anyone help where this code should be placed (body, header ?) or if there is a different example that will work.
Answer : iPhone page redirect
make sure it is placed befory you output anything to the client.
as soon as you send a single character to the client you will be unable to sond headers and therefore unable to send the location redirect header.
Random Solutions
Managing systems in a trusted domain from a single EPO server
asp.net Can I put more that one mssql table 'field' in one GridView Column?
Ethernet Tap
Does VOIP make sense for a small organization?
How to provide an additional/extra dll file when deployin a feature in sharepoint?
(Simple) Creating array, appending and recreating.
Adobe Flex: Browse For XML File(FileReference), Modify It, then upload it to server?
A comment triggers image display in IE6
Developing for W2K3 - Missing MSCVP100.DLL & MSVCR100.DLL
How can I make this function to work with null values? In VBA and MS Access