index.php?request=example or seperate pages..?

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!

Moderator: General Moderators

Post Reply
Dave2000
Forum Contributor
Posts: 126
Joined: Wed Jun 21, 2006 1:48 pm

index.php?request=example or seperate pages..?

Post 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 :)
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

Front Controller for the win!
aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Post 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).
Flamie
Forum Contributor
Posts: 166
Joined: Mon Mar 01, 2004 3:19 pm

Post 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 :)
aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Post 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.
Dave2000
Forum Contributor
Posts: 126
Joined: Wed Jun 21, 2006 1:48 pm

Post by Dave2000 »

Thank you. Does anyone else have opinions on this?
Post Reply