Results 1 to 3 of 3

Thread: Your Opinion on document types

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    41

    Your Opinion on document types

    What is your opinion on files for different purposes? I have thought about this a lot, and I can't decide. Is it better to package the whole website into one file (which is possible I suppose for php/html, but I haven't seen it) and/or why not? Is it better to package a website as individual files (like one for index.php, one for search.php, one for forum.php, one for register.php) and/or why not? Or lastly, is it better to package the website as generic files (one for index.php, one for uaaf.php [stands for user account action file, for registering, signing in, changing your account, logging out, etc], etc) and/or why not?

    Forgive me if that description is unclear

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Your Opinion on document types

    If you have ever used OOP. Think of a page as an object (this is how ASP.NET and JSP do it). Like that you will have a page for each symbolic object within your application, each of which will carry out a subset of tasks relating to the type of page. E.g: user.php: change password, update profile, send reminder email, delete account. cart.php: add items, change quantity of items, find total of all items.

    It is also advisable to follow the MVC (model view controller) design pattern when designing a web application. At the very least you should have two files for each page:

    user.php --> processes input / data
    user.tpl.php --> template to produce the output (no processing esp. DB queries )

    Also keeping separate pages for separate areas of your site makes them more search engine friendly and increases the number of potential visitors. So using a single page is a very bad idea.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Your Opinion on document types

    I use one index.php page, as many includes as I require to perform different tasks, and mod_rewrite to create the URL structure that I desire. There isn't necessarily any connection between the number of PHP files I use and the number of URIs I have.

Posting Permissions

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



Click Here to Expand Forum to Full Width