In a table called " Calls" in the "List page:Before process" event I am trying to get the program to determine if it is mobile or not. If it s mobile then go to list page 1 (list1) if it is desktop go to list page (list).
I can't seem to figure out what is wrong.. No errors are being thrown, All syntax seems correct.. It has me stumpped. Any suggestions would be greatly appreciated. Thank you in advance
Code below:
unset($_SESSION["listpage"]); //clears listpage session var
$isMobile = (bool)preg_match('#\b(ip(hone|od|ad)|android|opera m(ob|in)i|windows (phone|ce)|blackberry|tablet'.
'|s(ymbian|eries60|amsung)|p(laybook|alm|rofile/midp|laystation portable)|nokia|fennec|htc[\-_]'.
'|mobile|up\.browser|[1-4][0-9]{2}x[1-4][0-9]{2})\b#i', $_SERVER['HTTP_USER_AGENT'] );
if(isMobile())
{
header("http://mypage.com/calls/calls_list.php?page=list1");
}
else
{
header("http://mypage.com/calls/calls_list.php?page=list");
}
I can't seem to figure out what is wrong.. No errors are being thrown, All syntax seems correct.. It has me stumpped. Any suggestions would be greatly appreciated. Thank you in advance
Code below:
unset($_SESSION["listpage"]); //clears listpage session var
$isMobile = (bool)preg_match('#\b(ip(hone|od|ad)|android|opera m(ob|in)i|windows (phone|ce)|blackberry|tablet'.
'|s(ymbian|eries60|amsung)|p(laybook|alm|rofile/midp|laystation portable)|nokia|fennec|htc[\-_]'.
'|mobile|up\.browser|[1-4][0-9]{2}x[1-4][0-9]{2})\b#i', $_SERVER['HTTP_USER_AGENT'] );
if(isMobile())
{
header("http://mypage.com/calls/calls_list.php?page=list1");
}
else
{
header("http://mypage.com/calls/calls_list.php?page=list");
}