im trying to detect if the incoming browser is from a mobile/phone. found this code but it doesnt seem to work. can anyone lend a hand please
Code:
<?php
$main = "index.html";
$mobile = "mobile.html";
if(
$_SERVER['USER_AGENT']=='Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en)AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C25 Safari/419.3') {
header("location: $mobile"); }else {
header("location: $main"); }
?>