Browser Detection - HTTP_USER_AGENT issue

Note: If my last post gets posted I apologize for the double post, I got the verification e-mails a bit late and I realized by logging in it may not require moderator approval (and if possible I wanted to see if I could get a reply from someone today!)

So I am attempting to put a custom background on my iPhone and iPad websites since my background image is too large to display correctly on the iPhone and iPad as it is (really, apple? android works!) I attempted to simply add in a few more HTTP_USER_AGENT lines by duplicating them - my syntax unfortunately is wrong it seems since I cannot get the desired affect… if anyone has some guidance they could give me it would be VERY well received! I’ve struggled for many hours on this and I’ve accepted that I just need some help at this point if I want to move forward!

[php]<?php
if( Helper::checkNull($article) )
{
echo $article->getMetaTagsHTML();
}
?>

<?php if( strpos( $_SERVER['HTTP_USER_AGENT'], "MSIE" ) > 0 ) { ?> <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/template-ie.css" rel="stylesheet" type="text/css";

}

if( strpos( $_SERVER[‘HTTP_USER_AGENT’], “Safari” > 0 ) {
?>

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/template-ios.css" rel="stylesheet" type="text/css";

}

if( strpos( $_SERVER[‘HTTP_USER_AGENT’], “iPad” > 0 ) {
?>

<?php

}

?>[/php]

I find it interesting that the aboe highlights the internet explorer scirpt (which was there when I took this website over, and should work) but not the duplicates - if someone could explain this it would be amazing!

Also, I realize now I posted “Safari” in one duplicate, where it should say “iPhone” - I was just testing this and I realize it’s not on par with my query.

Sponsor our Newsletter | Privacy Policy | Terms of Service