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 Link to comment https://forums.phpfreaks.com/topic/180767-getting-unique-page-title-from-query-some-variables-not-showing/ Share on other sites More sharing options...
ashton321 Posted November 8, 2009 Share Posted November 8, 2009 What currently displays? What should display? Link to comment https://forums.phpfreaks.com/topic/180767-getting-unique-page-title-from-query-some-variables-not-showing/#findComment-953800 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.