So with help from others I have managed to get this executed and running correctly via PHP locally however I am having problems with the corporate web-server.
How can I go about the same thing using javascript instead?
I understand this is not responsive mobile design and there are much better ways of getting this delivered.
Would appreciate the help
<?php
// MOBILE
$blackberry = strpos($_SERVER['HTTP_USER_AGENT'],"BB10");
$blackberry2 = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$ipad = strpos($_SERVER['HTTP_USER_AGENT'],"iPad");
$chrome = strpos($_SERVER['HTTP_USER_AGENT'],"Chrome");
$safari = strpos($_SERVER['HTTP_USER_AGENT'],"Safari");
// REDIRECTS
// MOBILE
if ($blackberry == true)
{
header('Location: style.css');
}
else if ($blackberry2 == true)
{
header('Location: bb7.css');
}
else if ($iphone == true)
{
header('Location: style.css');
}
else if ($ipad == true)
{
header('Location: ipad.css');
}
else if ($chrome == true)
{
header('Location: style.css');
}
else if ($safari == true)
{
header('Location: style.css');
}
?>
window.navigator.userAgentbut I suspect this is even what you want to do in php