Originally posted by Aeiri
<? if(!empty($action) include($action.".txt");
else echo("Welcome to The Gaming Institution"); ?>
Using switch statements to change a value INTO the value you checked it against? That's a little strange...
It's also a bit more secure than just including unchecked variables from the user, don't you think?
You could do:
$tfile = '/my/path/' . basename( $_GET[ 'action' ] . 'txt' );
if ( file_exists( $tfile ) ) {
include( $tfile );
} else {
include( 'homepage.txt' );
}
Or you could do it your way and let visitors browse any .txt file on the server readable by Apache, that they can be bothered to look for.