easyedy Posted November 8, 2009 Share Posted November 8, 2009 Hi. I'm trying to call a unique page title from a query but some variables aren't showing and I'm wondering if I'm missing a step or coding it wrong... Here is my code that works and will display the title correctly with this URL: store.php?brand=adidas&category=golf&subcategory=shirts if(isset($_GET['brand']) & isset($_GET['category']) & isset($_GET['subcategory'])) { $pagetitle = $_GET['brand'] . " " . $_GET['subcategory']; } elseif(isset($_GET['brand']) & isset($_GET['category'])) { $pagetitle = $_GET['brand'] . " " . $_GET['category']; } elseif(isset($_GET['brand'])) { $pagetitle = $_GET['brand']; } else { $pagetitle = "Universal page title"; } But our store has a few feature to display price range ($100-$200) and sale items range (40% off) so I added 2 more if statements for price and clearance and it wont the sale from this URL: store.php?brand=adidas&category=golf&subcategory=shirts&sale=3 if(isset($_GET['brand']) & isset($_GET['category']) & isset($_GET['subcategory']) & isset($_GET['sale'])) { $pagetitle = $_GET['brand'] . " " . $_GET['subcategory']. " " . $_GET['sale']; } elseif(isset($_GET['brand']) & isset($_GET['category']) & isset($_GET['subcategory'])) { $pagetitle = $_GET['brand'] . " " . $_GET['subcategory']; } elseif(isset($_GET['brand']) & isset($_GET['category'])) { $pagetitle = $_GET['brand'] . " " . $_GET['category']; } elseif(isset($_GET['brand'])) { $pagetitle = $_GET['brand']; } else { $pagetitle = "Universal page title"; } I've tried everything... changing if statements.. redoing variables... etc. The sale and price variables are conditionals ie 1=10% off, 2=20%off etc would that have anything to do with it? thanks. Edy Quote Link to comment Share on other sites More sharing options...
ashton321 Posted November 8, 2009 Share Posted November 8, 2009 What currently displays? What should display? Quote Link to comment 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.