Evaluate my sytem

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

Evaluate my sytem

Post by harrisonad »

Hi, I created a system for the company website that uses quesry strings to determine the page requested.

An example is:
http://www.mydomain.com?section=music&page=albums

With this query string, the system looks for somefile named as 'music_albums.php' inside a certain folder, such as 'scripts/'.
The script has a single function named 'getContent()' that return the str of contents. The string is then incorporated to page as it's content.

But, I observed that many of the site uses many 'index.php' file inside folders that are named as the site sections.

So they could have used a url like this:
http://www.mydomain.com/music/albums/index.php

Is there something unprofessional with the system i created?
I need some evaluations here.
Thanks in advance.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

As long as you are careful to not accidently include the wrong file it's fine. You can make your query look like hardcoded folders using mod_rewrite (an apache module). Personally I don't see any reason for including files off the filesystem, I write a template class and call it from my files, which is the other way around from what you're doing. Another option is store your content in blob fields in mysql
Post Reply