Page 1 of 1
index.php?request=example or seperate pages..?
Posted: Thu Dec 21, 2006 1:04 pm
by Dave2000
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...
Thank you
Shears

Posted: Thu Dec 21, 2006 4:14 pm
by daedalus__
Front Controller for the win!
Posted: Fri Dec 22, 2006 2:10 am
by aliasxneo
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).
Posted: Fri Dec 22, 2006 2:31 am
by Flamie
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

Posted: Fri Dec 22, 2006 3:09 am
by aliasxneo
Flamie wrote: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.
Posted: Fri Dec 22, 2006 1:58 pm
by Dave2000
Thank you. Does anyone else have opinions on this?