Created
August 8, 2015 16:35
-
-
Save patriziosotgiu/3834d095936771573a49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////// | |
// PHP - Show single or conditional blocks on url change | |
//////////////////////////////////////////////////////////////////////////////// | |
//////////////////////////////////////////////////////////////////////////////// | |
// Single | |
//////////////////////////////////////////////////////////////////////////////// | |
$ads = isset($_GET['ads']) ? $_GET['ads'] : FALSE; | |
<?php if($ads == 'yes') : ?> | |
<div class="module-ad">im a html snippet area</div> | |
<?php endif; ?> | |
//////////////////////////////////////////////////////////////////////////////// | |
// Conditional | |
//////////////////////////////////////////////////////////////////////////////// | |
$version = isset($_GET['version']) ? $_GET['version'] : FALSE; | |
<?php if($version == '2') : ?> | |
show me if ?version=2 | |
<?php elseif($pattern == '3') : ?> | |
show me if ?version=3 | |
<?php else : ?> | |
show me by default | |
<?php endif; ?> | |
//////////////////////////////////////////////////////////////////////////////// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment