Created
March 28, 2012 15:13
-
-
Save luxifer/2227061 to your computer and use it in GitHub Desktop.
php controller in 14 lines
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 | |
if (!empty($_GET['p'])) | |
{ | |
if (is_file($_GET['p'].".php")) | |
{ | |
include($_GET['p'] . ".php"); | |
} | |
else | |
{ | |
echo 'error'; | |
} | |
} | |
else | |
{ | |
include("default.php"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment