Skip to main content

Website source code updated!

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.


Popular posts from this blog

Format MAC Address [JavaScript]

I am currently working on a project which will allow users to register their Wi-Fi enabled, non-web browser enabled, devices on the network. These are devices like printers, Apple TV, and Xbox*. One of the data points that have to be collected from the user is the device MAC address. The project customer wants that address to be properly formatted when they see it in the support ticket.

We have several options. We can format the address either on the back-end after the form has been submitted. Or we can format it on the front end via a separate text field for each character pair, but that is too many fields to handle. A better solution is to use a single field and format the user input at the time of input or upon submit. In those cases, the former is better because the data will already be formatted when the overall form input is being validation after the user clicks the “Submit” button.

We are going to format the user input as it is being provided, thus having proper data when vali…

How to setup Coda 2 to push to GitHub?

Setting up a new site in Coda 2 and cloning a GitHub remote repository is not that big of a deal. Where you will most likely run into problems is when you try to push your changes to the GitHub remote repository. Below I will show you how to update the Git config file in your local repository so you do not run into one of the following errors:
git push failed remote: Remote anonymous access to repository deniedgit push origin master Username: fatal: Could not read passwordThe GitHub repository address I am going to use is that of Source Code DNA: I will assume that you have already setup your Coda 2 site profile and cloned your repository, you have made some changes, and now you are ready to push those changes to your projects GitHub repo.

SNOOZ: Sound. Sleep.

I was on the Snooz Kickstarter page today, revisiting the project’s details and timeline progress. The device, which is a white-noise generating machine, recently became available for pre-order. Snooz is meant to be an alternative to having a TV or a stationary fan running at bed time. In my case, I bought it for my wife so we can get the TV out of the bedroom.

Whilst on the comments page I read the following comment, posted recently by Ken Tran:

I'm not a fan of the new fabric design. ...
I must disagree. If you take a look at the original design, which is all plastic and no style, I must say it is fugly. It is all utilitarian - not something I rally want to look at or see when I walk into the room. The final design, seen on the right, is something that beacons to be explored, looked at, utilized.

I am a big fan of Bang & Olufsen. They use fabric from Kvadrat in their line of products. Incorporating soft materials like fabric or leather in something which is meant to be place…