Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Index.php


  • Please log in to reply
2 replies to this topic

#1 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:06:55 AM

Posted 31 August 2008 - 09:22 AM

Hello all :thumbsup:

I've been working on something that's kind of like a content managemnt system, but not like existing things out there.

Point is, most of the page content is dynamicly generated.

I have seen many similar web apps use a single Index.php, which generates the entire page based on GET variables sent to it. Good examples are here, (Invision Power Board), and Joomla! systems.

All of the page is contained inside of the single Index.php.

My question is, is this considered good design practice?

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:55 AM

Posted 31 August 2008 - 12:50 PM

It is quite common for most (or all) of the code to be contained on a single page. It is also quite common for a page to call itself. All of the code for a single purpose is then kept on one page, making it (at least theoretically) easier to maintain. So as in the instance of BC, when you go to the main forum page, you could see one of several versions of the page, depending on whether you were logged in or not, and whether you are staff or not. It is still the main page, but just slightly different for each person.

It is also common for a form to submit information to the same .php file that created it. So in one case, if the get (or post) call returns null, then one thing is displayed. If the get (or post) holds data, then the page is rendered based on that information.

#3 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer

  • Topic Starter

  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:06:55 AM

Posted 31 August 2008 - 01:36 PM

Thanks Groovicus :thumbsup:
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users