bradkenyon Posted July 31, 2008 Share Posted July 31, 2008 I am using this php script to detect mobile browsers: http://www.andymoore.info/php-to-detect-mobile-phones/ I include the script at the top of the page, then do the if statement he used in the example, but when I view the page on a normal web browser, it shows nothing. Could someone help me out w/ what I might be doing wrong? Thanks. <?php include('mobile_detect.php'); if(detect_mobile_device()) { header('Location: http://m.domain.com/'); exit; } else { //normal website html } ?> Link to comment https://forums.phpfreaks.com/topic/117547-solved-detect-mobile-browser/ Share on other sites More sharing options...
unkwntech Posted August 3, 2008 Share Posted August 3, 2008 First thing just drop the else. Link to comment https://forums.phpfreaks.com/topic/117547-solved-detect-mobile-browser/#findComment-606805 Share on other sites More sharing options...
davemanjra Posted August 12, 2008 Share Posted August 12, 2008 *removed spam* Link to comment https://forums.phpfreaks.com/topic/117547-solved-detect-mobile-browser/#findComment-615153 Share on other sites More sharing options...
bradkenyon Posted August 13, 2008 Author Share Posted August 13, 2008 no, but i just pulled it up, looks interesting. thanks for the suggestion. Link to comment https://forums.phpfreaks.com/topic/117547-solved-detect-mobile-browser/#findComment-615463 Share on other sites More sharing options...
chenene101 Posted October 6, 2009 Share Posted October 6, 2009 Did you ever get detect mobile browsers to work? I have it working fine on a test page but it won't work on my existing .php page. Link to comment https://forums.phpfreaks.com/topic/117547-solved-detect-mobile-browser/#findComment-931669 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.