I'm having a strange problem. When I use this code to detect a mobile device, its causing my query dialog to stop working (on iPhone only - not tested on other mobile devices), but it works fine in my browser. Is there a way around this?
<?php
$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
$berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
$ipad = strpos($_SERVER['HTTP_USER_AGENT'],"iPad");
if ($iphone || $android || $palmpre || $ipod || $berry || $ipad == true)
{
//do something
} else { ?>
<div id="scrollerWrapper">
<div id="left_shopping_cart">
<?php include($_SERVER['DOCUMENT_ROOT']."/scripts/cart_side_products.php"); ?>
</div>
</div><!-- end#scrollerWrapper-->
<?php
} ?>
If I take out the first block, query works fine on my iPhone.