Skip to content

Instantly share code, notes, and snippets.

@IQAndreas
Created August 19, 2014 02:27
Show Gist options
  • Save IQAndreas/0a8c4994d68649ba231f to your computer and use it in GitHub Desktop.
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
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