After half a dozen completion attempts and numerous changes to the code I have completed the reconstruction of the website’s pervious multiple page structure to a single page with “if else” statements. This structure is not exactly what I wanted it to be. For one I am not using the SQL database like I had planed before I started. Two I am using a lot more include now, which is opposite of what I wanted to do, if you remember from my post yesterday.
When I first started working on the website today, I began with a SQL database, but because of the way SQL and in particular PHP work, I was not able to use a database. For now! SQL is designed to store plain text. It should not contain any code. The few includes I was using would not execute. After spending couple of hoarse trying to figure out why none of the includes would run, I got in touch with a friend of mine. Jason, who runs his own hosting business. His company is called Hax the Planet. He explained to me that because SQL is designed to only store data in plain text and because the PHP parser runs only once when generating a page, the page contains whatever was in the data base. In this form the page contains the unexecuted include statements, which is why I was always ending up with missing content.
In direct result of the above I had to forget about using SQL database for now. I only need one for vast amount of text content, but at the moment I think I am doing just fine with integrate WordPress into other sections of the website, not just my blog. This is also how I end up opposite of what I had planed and using more includes than before. From all the previous web pages I was using, I got rid of the templates and only kept the actual content of them. So, now I have one index page with one template’s design to maintain, and a simple “if else” statement to update when necessary. It is much easier to make new pages, and keep site content up to snuff.
For now I am happy with the code of the site. The next step of the site update will be a facelift. I am going to work on some new graphics and experiment with some new colors. Once that is done, I might start recoding the site again. LoL, I know next time would be much easier.