How can I use another page to view on iPad?
if($_SERVER['HTTP_USER_AGENT'] == 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10') { echo "That is an iPad"; }
See http://developer.apple.com/safari/library/technotes/tn2010/tn2262.html
Also, if you are not worried about an exact match, you might consider something like:
if(stristr($_SERVER['HTTP_USER_AGENT'], 'Mozilla/5.0(iPad;')) { // probably an iPad }
You can sniff the iPad user-agentheader using $_SERVER['HTTP_USER_AGENT'], but ideally, if you can recognize things that you want to be different from the iPad compared to any other device, more reliable and flexible than the agent who sniffs.
user-agent
$_SERVER['HTTP_USER_AGENT']
, , , , .
if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) { echo "You are on an iPad"; }
:
Mozilla/5.0 (iPad, U, CPU OS 3_2, Mac OS X, en-us) AppleWebKit/531.21.10 (KHTML, , Gecko) /4.0.4 Mobile/7B367 Safari/531.21.10
, "iPad".