Can someone tell me the correct syntax for checking a members session for multiple Product ID's before displaying code? Something like... <?php include('../amember/config.inc.php'); $_product_id = array('ONLY_LOGIN'); require($config['plugins_dir']['protect'] . '/php_include/check.inc.php'); if($_SESSION[_amember_user][data][status][7]){ // I want the line above to check against multiple products like 7,9,10 rather than just 7. header ("Location: /members/IPA/welcome-index.php"); exit; } // and then I want the code displayed here if logged member meets the above criteria //then place an else statment here to redirect them to a sales page if they dont meet the if criteria. The key ingredient here is code that I can place at the top of any page to either show the content or not depending on access, but again I want to check against multiple product id's because the same content may be offered in several product groups. Thanks in advance for any assistance. JPJ
Hello Tim Is this what you need ? $same_products = array(7,9,10); foreach ((array)$_SESSION[_amember_user][data][status] as $product_id => $status){ if ($status && in_array($product_id,$same_products)){ $too_bad = true; } } if ($too_bad) header ("Location: /amember/signup.php"); else header ("Location: /members/IPA/welcome-index.php");
Much appreciated.... I beleive tht is what I am looking for. However rather than a redirect here > header ("Location: /members/IPA/welcome-index.php"); How can I have it execute page code rather than use the header tag? JPJ