Like a lot of people in web development I taught myself instead of doing courses or reading books (ok, I read one but didn´t finish it). With an internet connection you can find out most of the stuff on t´internet somewhere.
Point is as you learn more and just get more experienced then you start improving and doing things different. A project I´ve been working on for nearly two years, Find Locally has now got to the release stage and is a huge amount of code.
When I started it I broke up the files into folders such as "home", "images" and "content" and let all the files use the require() function to pull in header and footer files from one directory. This was all done using relative paths so that i could work on it using several development servers with different document roots.
Now that it´s ready to go live I´ve decided firstly to switch to absolute paths in the template files and also to change some of the paths, e.g. from http://findderby.co.uk/home/mission.php to http://findderby.co.uk/about as it´s more user and search engine friendly. Since I´d gone over to absolute paths for images etc, this wasn´t too bad as it meant updating some links in the template files and some random 404 and header() stuff (since I couldn´t be bothered to create new folders, I just required them from the document root on a 404 error).
The problem came when I looked at one of the files I hadn´t updated. It was throwing up the usual error message when PHP can´t find the file used in a require() funtion. Found out this was the database connection file require()d in the template file as the paths had changed.
Luckiy I remembered that include() doesn´t throw up errors if it can´t find a file. So I simply put two includes in, one for each of the two types of file. This meant that the code I needed got executed and the one with the wrong path just got ignored. Quite a good work around if anyone find themselves in a similar situation. Remember though, if an error occurs in an include() file it will carry on so probably not best to use it for critical code.
Don´t you just just love my long rambling stories when I could probably sumarise the entire site into a <ul>