The little hidden things


Have you ever had one of those days where you focus on a tiny little thing, only to learn that some time later, (possibly hours), you had an even smaller detail incorrect?

Traditionally, when building a website, I used a CMS that handled a lot of the heavy lifting. I didn’t have to worry about duplicating headers and footers. Recently, I have stepped out of that comfort zone and created a site based on a bootstrap 3 template. I soooooo dislike cutting and pasting the same information across multiple pages. Enter my current buddy, php! In order to get it to run within an html file, I needed to make a few changes.

This may sounds little naive, but I had previously had very little experience with php. Yes, I have been playing in the web space for a while, but I never professed to be a full stack developer, nor know everything there is to know in how to build a site.

Here comes the rub… Thanks to the CMS, it has also been a long time since I have had to edit the .htaccess file. I did a little research, and in order to get my php based header to work, the site hosting has to support it. Check. And it has to be enabled in the .htaccess file. Which brings me to the point of this post. I found the  commands needed to make this happen, and set about editing the htaccess file I found from the previous site version. Take that last sentence as a literal statement, and look closely…

I was editing htaccess, with no “.” in front of it… Which means I was doing absolutely nothing to help my cause. After about 45 minutes, countless variations, and one article that made me actually pay attention, I realized I was not editing a hidden file. And thus, no matter what I stuffed in there, I would not get my header to populate.

60 seconds after the revelation, I had a working, php based header! Sometimes, it is literally the little things that trip us up. In this case, it was a period.

Will I continue to learn php? I don’t know. I have a few things on my plate on which I am trying to move forward, and not sure I will have time to devote to learning another language. That focus could shift, so only time will tell.

Below are some of the pages I referenced while figuring this all out.

https://www.rssinclude.com/blog/36_how_to_run_php_scripts_in_html_or_htm_files

http://deano.me/2013/06/running-php-in-htmhtml-files-using-htaccess-troubleshooting/

http://www.besthostratings.com/articles/php-in-html-files.html

,