Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder musher's Avatar
    Join Date
    Jan 2005
    Location
    Minnesota
    Posts
    203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Site building with PHP question on comment by missing-score

    http://www.codingforums.com/showthread.php?t=84551
    Quote Originally Posted by missing-score
    But for a small portfolio site, I feel his linking method is really inappropriate... IMO, it would have been better to use more than one page or at least use something like: ?page=contact so its human readable.
    Hey missing-score quick question (or whom ever else) is this a bad practice?
    - some of the sites I've built have a MySQL back end (so clients can update site info) and I set it up so all pages open with a single file index.php
    (IE: index.php?page=contact, index.php?page=about us, or index.php?page=about us&subpage=employees, etc).
    - Is it a better practice to create a separate page for each section?

    If figure since this delt more with PHP and not really a general site question that it should be posted here rather then the General Web Build Form (if not please move).
    Thanks
    Jim M

    "Lord, help me to become the person my dog thinks I am" - Dawn Ewing
    "If you must know. Yes, I do enjoy running after the dog sled when I fall off" - Me

    www.huskyzone.com -- Woodland Siberians

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is it a better practice to create a separate page for each section?
    Nope, if you read/learn the MVC approach you will realize using one page is best .. having multiple pages leads to redundancy and maintenance issues. some may bring up the issue about not being SEO friendly by sending everything through one page but this is where mod_rewrite comes in and allows for SEO friendly URL's.
    the purpose of having one page is to have it act as a 'switch board' to the rest of your site, how this is handles varies. from a simplistic approach you are actually using switch() to a more advanced using a framework that takes advantage of OOP/XML/and so on.

  • #3
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    Have a search for 'page controller pattern' for more information, having a single point of entry (for a particular use case, having both browsers/users and web-service requests coming to the same place is probably not sensible or necessary) is generally a good idea, but that script should be looking to pass control to something else as quickly as possible- it shoudn't do anything that isn't necessary.

  • #4
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, I use the MVC pattern for large applications... But for a portfolio I personally hardly see the point, unless it is a very big portfolio.

    What I was getting at though, was the resulting URL. Whether he uses one page or many pages, using:

    Code:
    http://site.com/page.php?go=x
    Where x is a number, just doesn't seem appropriate to me for a small site where the content is clearly separated and the creator knows whats going to be on each page.

    For example, within a forum or a blog, you will often find entries referenced by their ID's... why? Becuase the person who puts the forum online does not know exactly what will be posted and how many times etc. You can get systems for vB that clean up URL's to make them more friendly (eg: this would become something along the lines of

    Code:
    http://www.codingforums.com/thread/Site-building-with-PHP-question-on-comment-by-missing-score
    However when you have a low number of pages, and you know exactly what each page contains, I feel:

    1. It is a waste of time to implement an MVC pattern unless you want to for the learning experience
    2. It is bad to use page Ids which is probably not helping search rankings or anyone looking at the URL
    3. There is nothing wrong with using some good old static XHTML to build the pages


    Basically what I was trying to get at was that the result isn't good in any terms... Although I dont see anything wrong with using some static HTML or multiple pages for a something small like this, even those that think MVC should be used for everything should be able to see that this is a bad implementation.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •