Created
August 19, 2014 02:27
-
-
Save IQAndreas/0a8c4994d68649ba231f to your computer and use it in GitHub Desktop.
`switch(true)` abuse. This is a neat trick, but should obviously never actually be done. See http://stackoverflow.com/q/25373912/617937
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
switch (true) | |
{ | |
case (!isset($_GET['action']): | |
require('menu.html'); | |
break; | |
case ($_GET['action'] == 'debug'): | |
require('core/actions/debug.php'); | |
break; | |
case ($_GET['action'] == 'submit'): | |
require('core/actions/submit.php'); | |
break; | |
case ($_GET['action'] == 'admin'): | |
header("Location: /login"); | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment