Jump to content

fhunkydelix

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Posts posted by fhunkydelix

  1. There are different ways to organize, but I prefer using a front controller, an index.php in the root dir that is always loaded first.  This index.php will then make the determination of what other files to include, whether they be in the root or another dir.  This makes includes very simple because everything is relative to the root indexd.php.

     

    The problem with loading and index.php from another dir directly is that all subsequent includes will be relative to that file.  This is very difficult to maintain.

     

    So what do you suggest? get rid of the idea making each subdirectories into folders? and just throw it all into the root?

  2. Hello, I have a serious problem with includes

     

    So in the past I didn't have any organizing done when creating a website it was just the root and I throw in my files and a folder for the images. Now I am organizing my files something like this http://www.flickr.com/photos/41987677@N03/4926503042/.

    Now in index.php on the root folder I included the top.php, bottom.html and sessions.php as seen on global folder and inside of top.php and session.php are more includes to files like global.css the javascript files and images like logo and background of the top. now everything worked fine on index.php(root) and displayed everything.

     

    Now under the karoobridge folder (index.php) I included the top and bottom files on global now its throwing an error. My question is: is the organization I'm using useless with includes should I stick with just throwing everything on root directory? Can you give me some advice?

     

    Sorry if my explanation is confusing but I think you get the idea.

     

    I also tried $_SERVER["DOCUMENT_ROOT"] and put that in the index of karoobridge folder to get the top.php, though i got the file the image in top.php didn't appear (I also used $_SERVER['DOCUMENT_rOOT'] for the images) what could be the problem?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.