I have 5 game sections that will use the same template sheet, but they will all pull data from a different table in mysql in the same database. However, I am incorporating this: http://stackoverflow.com/questions/1712973/how-to-include-config-php-efficiently/1713000#1713000
Okay, so here's how I was planning to tackle it. For example, let's say I go to index.php?page=pokemon then I was planning to set $game_name to $_GET['page'] and then use $game_name to select the table (assuming I made the table name pokemon) and then all the data would be pulled from mysql properly. Is there a better way I should do this?
Next, in the situation where someone tries to go to an non-existent game then I want it to redirect to the homepage. For example, let's say they misspelled pokemon to poekmon and went to index.php?page=poekmon then it would properly show a blank template without data right? Instead, how can I make it just redirect to homepage if it was a game that doesn't exist?
This is kind of similar to how wordpress is setup. It uses Single.php as a template and then grabs data from the database.