dflow Posted April 27, 2009 Share Posted April 27, 2009 this is what i want to achieve show an banner on a specific page an for a specific citylevel==1 it works fine with the $curpage alone adding the $Citylinks value to the if statement shows nothing here is the code <?php function curPageName() { return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); } $curPageName = curPageName(); ?> <?php if ($curPageName == "city_hotels.php" && $Citylinks['CityLevel']==1) { ?> <a href="http://mysite.com/eng/city_apartments_eng.php?Langeng=1&CategoryID=2&CountryID=<?php echo $_GET['CountryID']; ?>&CityID=<?php echo $_GET['CityID']; ?>&affid=othersite"> <img src="http://mysite.com/images/city_apartment_banner.gif" width="773" height="93" border="0"> </a> <?php } else { ?> Quote Link to comment https://forums.phpfreaks.com/topic/155875-help-with-if-else-with-many-conditional-values/ Share on other sites More sharing options...
Cosizzle Posted April 27, 2009 Share Posted April 27, 2009 what is Citylinks? can you echo that outside the if, perhaps nothing is being passed to it? Quote Link to comment https://forums.phpfreaks.com/topic/155875-help-with-if-else-with-many-conditional-values/#findComment-820454 Share on other sites More sharing options...
dflow Posted April 28, 2009 Author Share Posted April 28, 2009 $Citylinks is the recordset name it can be echoed outside the if Quote Link to comment https://forums.phpfreaks.com/topic/155875-help-with-if-else-with-many-conditional-values/#findComment-820800 Share on other sites More sharing options...
mikesta707 Posted April 28, 2009 Share Posted April 28, 2009 are you sure your current page name function works correct? Before you run the script, output both of the variables you are testing, and see if they have the values you expect them too Quote Link to comment https://forums.phpfreaks.com/topic/155875-help-with-if-else-with-many-conditional-values/#findComment-820804 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.