PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am making a game - so the majority of my site is member only. At the moment, I have different pages, such as example.php example2.php example3.php . However, I was thinking of restructing the site; so that the various pages are loaded through a get request on the index.php page, such as index.php?request=example and index.php?request=example2
What are the pros and cons, with security in mind, to these different approaches, and which do people recommend I use...
I like the index controller method the most, personally I have never been for seperate pages. It allows me to organize all my data behind index.php rather than having multiple pages. Then I just take a simple security measure by defining a global variable in index.php and making sure it's set in any other files to make sure the other files are not directly being accessed (as an attempt to exploit the site).
aliasxneo wrote:I like the index controller method the most, personally I have never been for seperate pages. It allows me to organize all my data behind index.php rather than having multiple pages. Then I just take a simple security measure by defining a global variable in index.php and making sure it's set in any other files to make sure the other files are not directly being accessed (as an attempt to exploit the site).
or just store the files outside your public_html, so they cant be access unless included
aliasxneo wrote:I like the index controller method the most, personally I have never been for seperate pages. It allows me to organize all my data behind index.php rather than having multiple pages. Then I just take a simple security measure by defining a global variable in index.php and making sure it's set in any other files to make sure the other files are not directly being accessed (as an attempt to exploit the site).
or just store the files outside your public_html, so they cant be access unless included
That might work too, although of all of my life programming I have never seen a person do that before.