html - How to get a div class to be displayed on certain pages using a template and php -
i have template web pages want div class not seen on pages. use url content out of database php example of url = index.php?categorie=navigatie_bar&onderwerp=startpagina
i need code catagory url , if catagory not navigation_bar
echo '<div class"fb-comments"></div>'; can ?
<div id="container"> <div id="pagina_text"> {{ content }} </br> <div class="rw-ui-container"></div> </br></br> <?php if(strcmp($_get['categorie'], "navigatie_bar") != 0) { echo '<div class="fb-comments" data-href="http://alledaagsetips.nl" data-numposts="10" data-colorscheme="light"></div>'; } ?> </div> <!-- end pagina_text --> </div><!-- end container -->
you can access url variables via $_get['name_of_parameter'].
if(strcmp($_get['category'], "navigation_bar") != 0) { echo '<div class="fb-comments"></div>'; } in case, if index.php?category=navigation_bar div echoed.
take attention spelling, in example wrote catagory instead of category
edit: can $_get['category'] == 'navigation_bar', string comparisons safer use strcmp (string compare) function. see string comparison using == vs. strcmp
Comments
Post a Comment