uniquelylost Posted July 12, 2013 Share Posted July 12, 2013 Hi, I have been working on coding multiple mobile redirects that can be entered via a form... I can get it to work fine without the form but once I introduce the form I can only get the first redirection to work and if I try to add additional ones like 'pagetitle_url22' they don't work... I can confirm that the values are getting saved in the db... here's an example of my code- function emr_single_page_only(){ global $emr_options; if (is_page(get_option('page_number11'))) { emr_mobile_redirect(); } elseif (is_page(get_option('page_number22'))) { emr_mobile_redirect2(); } } add_action('get_header','emr_single_page_only'); function emr_mobile_redirect(){ global $emr_options; if ($emr_options['enabled'] == true) { $detect = new Mobile_Detect(); if ($detect->isTablet() && $emr_options['tablet'] == true) { $detect = "false"; } elseif ($detect->isMobile()) { header('Location: ' . $emr_options['mobile_url']); exit; } } } function emr_mobile_redirect2(){ global $emr_options; if ($emr_options['enabled'] == true) { $detect = new Mobile_Detect(); if ($detect->isTablet() && $emr_options['tablet'] == true) { $detect = "false"; } elseif ($detect->isMobile()) { header('Location: ' . $emr_options['mobile_url22']); exit; } } } Any suggestion are appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/280105-multiple-mobile-redirects-form-value-problems/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.