banner banner banner banner banner banner banner banner








Recent Posts






































MARCH 30, 2021

Weight Tracking

I've kept my online weight tracking system privately published, but have really enjoyed all I'm learning about text file management with PHP and HTML. It's been very interesting, as usual, to see just how much code is already out there and available to be adapted and adopted to meet my needs. and are great for purposes of research, but I particularly like and the interactive nature of Q&A on that site. I've found solutions for a great many of my needs on that particular site, and I've even managed to find plug-and-play examples for some of the code I needed. Best of all, everything I try to build brings with it a great deal of new examples and sample code that can be reapplied in future projects.

In my private weight tracking system, when I input and store the data, PHP defaults to store the data with the most current entries at the bottom of the file. That's fine with me overall, but it doesn't provide a very good user experience (UX) in some cases.

For example, I don't want a user having to scroll down through a long list of data to get to the most current entries. I would rather have them on top of the list so they are seen up front and on top. To avoid that problem, I found the following:

$file = array_reverse($file);

Applying a simple array_reverse allows me to reverse the order of a stored text file. That combined with a simple echo command re-sorts and displays a file with the most current data at the top of the list. Just what I wanted!


MARCH 18, 2021

Bug Fixes

I mentioned yesterday that I needed to correct a bug (problem) with the way my online log was performing. It works, but it's not performing in the manner in which I intend it to perform.

Turns out I am able to just click the Comment button (for the online comments) or the Submit button (for the online weight tracking log) without entering a respective comment or daily weight and the result is a blank row of data in the file.

I discovered the ability to make the comment and weight fields required to prevent this problem from occurring. It was a nice and easy fix once I searched the internet to find a coded example of the required attribute for a form field. That's all it took and things shifted to good working order.

And, now to chase down the coding approach to sort and save the file with the most current row up top and the least current row at the bottom. I don't want to have a user scroll through a large set of data to locate the most current information.

This coding exercise may prove to be a bit more difficult than I would have anticipated. That's because similar coding examples that I've seen so far have tended to demand a lot more effort than I would have imagined.


MARCH 17, 2021

Online Weight Log

I set up a private online weight log using the same technology I developed for entering and reviewing comments - except I'm tracking my weight on a daily basis and publishing it privately.

I'm basically doing this to shift my weight maintenance log from my computer to my phone. I like the idea of having that data readily available no matter my location. I also like the idea of being able to enter that data remotely.

In yesterday's post, I mentioned a bug in terms of the way this new technology performs versus the way I want it to perform. I'll have the same problem with this new online weight log until I determine how to correct it.

I also want to make one other change and track the new data at the top of the log instead of tracking it at the bottom of the log as is currently the case. I've seen coded examples of this and hope to be able to plug in the new code and make the desired change. If/when I get it working, I would like to inject the same change to my comments feature to keep the most current comments at the top of the log.


MARCH 16, 2021

More on Comments

After additional thought, I decided to go ahead and add a feature that provides a limited form of comments to the website. I added the capability for general comments, which can be placed on one location only for both writing and reading about any post.

The feature is accessed from the comments menu item over to the left and immediately below the blog menu item. I doubt the feature will be used very much, but I thought it might be fun to develop and offer - just in case.

As of this writing, comments can be added and read, but there is also a bug in the way it operates versus the intended way it should operate. Hopefully, I'll get that corrected soon.


MARCH 08, 2021

Blog Comments

I spent some time yesterday developing a feature to record and display comments on a blog post. It was fun to build, but I do not intend to roll it out on a site-wide basis.

It was more about the fun in creating it than introducing a relatively unused feature to the blog. After all, I'm breaking all of the rules that need to be followed in order to develop a consistent and dependable readership.

NOTE: Since creating this post, I decided to roll-out comments just in case someone wanted to comment. As of this update (3/21/21) the comment feature has not been used but can now be found in the upper portion of the left menu.


FEBRUARY 27, 2021

Website Archives

As a new month approaches, I know it's about time to get in gear and prepare a new archive for all of the posts in the most recent month. It's definitely not worth trying to automate the process as is the case with most modern blogsites. And, to be honest, the required effort to archive the previous month's posts in a more manual fashion does not involve much more effort than is required just to publishing a new post.

The archival process is something I look forward to because it demonstrates continued progress as more and more monthly archives are generated. And, I've been true to my (until now) unspoken goal of creating a post each and every day, which makes the archival process even more worth while.

I also like the button I generated for the archives feature over in the left-hand menu and the way it ties into this monthly effort. The button presents a nice alternative versus other options when it comes to saving website real estate over in the menu area.

If I should add more categories, I'm thinking about adding the same functionality there as I have in he archives section. However, I'm quite a distance from taking any definitive steps in that direction. I'll need to generate enough posts on a single topic in order to justify such a new category. Presently, spiritual, running, and website tend to earn most of my attention when it comes to website posts.


FEBRUARY 08, 2021

Website Visitors

My writing posts here on the blog, designing the website, building new features, getting creative, and dabbling with the technology all have one thing in common:

I don't do any of them with the aim of engaging an audience.

I know, it sounds a bit odd.

But, it's true.

Every now and then I will write a post like this one just in case the rare visitor drops by and doesn't happen to read my about page, where I have also explained a few of my reasons for doing what I do here on the website.

The logging feature that I built will indicate I have visitors from time to time. But again, that's not the goal. All I can really see in the log is that I had a visitor visit my website via a web service provider or I had a visit from one of the countless web crawlers that serve all of the major and lesser known technological organizations.

So, I don't know anything about the individual users or the folks working behind the scenes with the corporate crawlers. And, I haven't added any comments capabilities either because connecting is not why I do what I'm doing here.

The times on the log entries also provide a hint as to the origin of the hits. For example, a web crawler usually just hits a page and moves to the next one. So, from one hit to the next from that crawler, the time intervals between hits are usually quite small and insignificant.

On the other hand, a legitimate user working via a web service provider will take the time to read various pages. And, the time it takes to do that also shows up in the log and tends to suggest that it was indeed a user who visited. That's about as close as I come to engaging an audience and serves my purposes completely.

Believe it or not, I actually had a user who was able to add some malicious code to one of the fields in my log. The program that I wrote to display my log also executed the malicious code as the user must have intended and anticipated. For anyone who is curious, that's what is known as a SQL injection and was executed by the PHP program that I mentioned I had written to display the log.

Fortunately, the code that executed initiated a sequence of events that required a response from me to proceed. While the request for a response looked very legitimate at first glance, it still looked just suspicious enough to tip me off before I responded. And, by closing things down without responding, I was able to prevent any damage to my system.

Chasing that code down, to determine the origin of the problem, was quite an interesting exercise. It was my first exposure to malicious code presented via a SQL injection and my first ever exposure from the victim's side of an event.

That's just one more reason that I enjoy building and adding to this website. There's so much to learn about so many aspects of the technology, especially including security and the efforts from hackers made against the code I write.

Still, if you are reading this and want to reach out to me for any reason, feel free to use the CONTACT menu link in the left column or follow the right column to my Twitter account and ping me there.


FEBRUARY 02, 2021


I'm always impressed with all of the coding examples that are just waiting to be discovered out on the web. I'm especially amazed at how much there is to learn by plugging in the code and then making very small changes to try and achieve a specific result.

That was exactly the case last night as I went about trying to develop a dropdown box for the menu access to my archives. As I continue to add monthly archives, the entire feature has begun to occupy too much website real estate so I wanted to recapture space by converting the whole thing to a dropdown box.

I didn't like the simplistic examples that used web forms to accomplish the task. I'm not real excited about the idea of having to select an archive from a dropdown list and then hit a submit button to be taken to the appropriate archive. I wanted to produce what I've already seen on major blogging sites where an item in the dropdown box list is selected and automatically delivers me to a specific location in the blog.

I also wasn't really excited about debugging javascript to achieve the effect and found a CSS dropdown button example that looked very enticing. I plugged in the code and then started dabbling with the CSS in the primary style sheet until I got things just the way I wanted them.

It was a great learning exercise and a lot of fun to build it out and tailor it to meet my needs.


DECEMBER 14, 2020

PHP Code

Back on December 09, 2020 I published a blog post about Website Stats. I didn't think about it at the time, but it's a post that I can, and probably will, expand over time. In fact, I just finished updating it with some new capabilities. I've also added it to the website menu since it's self-updating each time it's accessed and will therefore produce a report of current information each time someone visits that page.

While it was not easy, and while I had to familiarize myself with some new PHP functions in the coding process in order to get it all to work; it was in fact easier than I had anticipated. I thought I was going to have to build some new files, but was able to process the data and report it in realtime without having to store and track any information in additional files.

I really like using PHP to perform calculations, store and track data, and work with simple graphic designs. It's much more sophisticated when combined with a SQL database instead of flat files and when working with complimentary front-end languages such as javascript. Still, you just can't beat PHP for it's all around capabilities. And unlike BASIC (another language with which I still really enjoy working) I particularly appreciate its extended reach when dispensed over the world wide web.

I really enjoyed adding more analytics capabilities yesterday and plan on doing more development as ideas come to mind and time permits.


DECEMBER 09, 2020

Web Stats

Years ago I constructed a log for my website. Every time a hit occurs against my website I log a number of pieces of information about the hit including the new grand total of hits against the website.

As of this view of this webpage, the new grand total of hits is 20451.

This variation of my logging program started collecting data on 11/02/20. Based on GMT (time), today's date is 04/13/21.This means we have logged 162 days of data. This also means there has been an average of 126 hits per day.

The date for today is 2021/04/13
The date for yesterday was 2021/04/12
The date 2 days ago was 2021/04/11
The date 3 days ago was 2021/04/10
The date 4 days ago was 2021/04/09
The date 5 days ago was 2021/04/08

Hits so far today = 191
Hits for 1 day ago = 179
Hits for 2 day ago = 123
Hits for 3 day ago = 213
Hits for 4 day ago = 144
Hits for 5 day ago = 166

Average hits for 5 full days = 165

I also collect the IP address for each user or organization that visits my website and I use an IP location finder website to determine the visiting organization or internet service provider.

I am totally amazed that almost without exception, all logged hits against this site have come from web crawlers originating from organizations such as Google, Amazon, and Microsoft, not to mention other major organizations all over the world.


DECEMBER 07, 2020

Search Feature 2

In an effort to remain true to form (no pun intended!), I'm bringing another website related post to the blog. This time I'm writing about a new Search Feature that I've introduced to the site.

I had to think long and hard about how I wanted to accomplish this task. I came across some PHP code that was new to me and that helped make the task a lot easier. However, based on my design, providing a search capability still adds a bit of overhead to each post. The good news is that it's still manageable.

I knew I would need a Form to collect the search terms. With that form I was able to provide a search box and search button on top of the right margin to perform the collection.

Next, I would need to pass the search terms to a variable in a PHP program. In order to pull that off, I grabbed the search terms from the form in 'val1' and handed them over to a PHP variable named '$srchstr' using PHP's htmlentities function as follows:

$srchstr = htmlentities($_GET['val1']);

Next, I needed to build my search string and assign it to a PHP variable. In other words, I needed to take the post for any given day and wrap double quotes around it and set a PHP variable equal to that lengthy string of text.

Whenever I'm testing PHP and the screen goes blank, I know I've got a problem. This was the case until I followed the information in the error log and discovered I had double quotes located in my posts that were adding confusion to the PHP program. Note to self: No more double quotes in my posts.

Next, I added a PHP If statement to see if my search terms were located in that lengthy string and, if so, to set a $flag equal to '1' and present a message that the terms were found, providing the specific location where a user might go to read the post that includes those terms.

Finally, at the end of my program I checked to see if $flag = 1 and if it was not, and was instead still equal to '0', then I presented a message to the user that the program was unable to locate the search terms. I also combined all of the lengthy text strings into one file so that everything could be searched in one easy effort. And, I simply add each new post to that file to keep the search function operational on an ongoing basis.


NOVEMBER 30, 2020

More Web Stuff

Adding the capability for Recent Posts and Post Archives was fun and taught me a lot about what goes on behind the scenes with the code in familiar blogging sites like WordPress and BlogSpot. Admittedly, it would take me an eternity to match the features and capabilities coded into those sites, but that's honestly not the goal.

My most important goal in building this website is to have fun! Creating a maintenance nightmare is the last thing I want to do. So, any feature that adds overhead, in the form of routine maintenance or overwhelming complexity management, is carefully considered before any work begins.

If adding a new feature will drag me kicking and screaming toward a new technology that adds too much work and/or overhead for too little benefit, then that feature and that technology are not destined to find a place in my website.

On the other hand, if the effort to add a feature or capability can be easily contained to avoid that scope creep with which those of us who spent time in the corporate world are so familiar, then it is likely to find a place on my website development to-do list.

There's a lot that I know I'm sacrificing in order to enjoy the control I maintain over this blog site. For example, on a traditional blog site when you click the Publish button, a lot of things can be user defined to happen behind the scenes, such as notifications. Do I want to build a publish function? If I did, I would be forced to use it and lose any benefit that comes with the changes I can make in a manual publishing operation. A publish function fits well in my too complex to build and maintain category.

Another example of sacrifice is the built-in audience that comes with a more traditional blogging site. I used to live on WordPress and they do a great job of driving users to each other's blogs. In its season, I enjoyed that.

But the level of sophistication that has evolved, in terms of advertising and monetizing, is just not something with which I want to be involved. In fact, and as I have said before, I'm not even looking for an audience. I'm just looking to have fun with the technology and perhaps the opportunity for writing and artistic creativity that come with building and maintaining a website.


NOVEMBER 29, 2020

Website Stuff

Decades ago, when I started playing with HTML and my first website, I discovered PHP, and in particular PHP includes. The entire idea of PHP and server-side code opened a new door for me back then, even allowing me to draw from my extensive experience with relational databases and SQL.

With PHP includes, I was able to reduce (and almost eliminate) the redundant HTML and content I had been using in so many places and which had become such a major chore to update when anything changed. These PHP includes were a great addition to my website developer's tool bag!

Still, old habits die hard as they say and while I found myself learning new and improved techniques, I was not always recognizing their potential application and the places where they might benefit me. I had a very good example of that occur just today.

In the past when a new year arrived, I often found myself weighed down with extensive updates changing all of the years in the copyright notices over to the new year. Even today I was realizing that project was looming large and only a month away. Without giving it a thought, I was mentally preparing to take on that annual project. But, then it occurred to me - couldn't I add that copyright notice in a PHP include and update it only once instead of a multitude of times?

How in the world had I missed something so simple? Well, the answer resides in the way I initially set things up. To keep things neat and tidy, I host all content on an HTML page and I host each HTML page with a PHP page that contains all of the structural definitions.

The copyright notices had been added like content on the HTML pages as I had always done before. But, if I were to update the copyright notice in one location and build an include for that location in the PHP page's structural definitions, I could relieve myself of that annual (and tiresome) project and make the update in one location!

I just completed that change and it seems to be working well. No more lengthy projects for copyright notice updates. Now the copyright notice updates for the New Year will be like flipping a switch!


OCTOBER 16, 2020


Had a fun time adding some updates to the website yesterday. As I have mentioned before, it's probably the thing I enjoy most about having a website/blog.

I added the capability to see recent posts which required some retooling of the infrastructure. It was probably the most demanding and time consuming change that I made to the site in yesterday's changes.

I also removed my Twitter feed on the right side and moved some menu items from the left side to make room for the recent posts menu entry. And, I dabbled with the menu labels font size to allow for more text without a crowded appearance.

I added a website archive and performed some modifications to the main page to ensure a proper alignment between it and the left and right menus, both of which were quick and easy changes. I added back my genealogy post from an earlier entry on my previous website since it's something to which I like to refer back from time to time.

Finally, I modified the Home section so that the entries from the current month will always show up on the main feed. I may dabble with that some more, but need to give it some additional thought.


OCTOBER 11, 2020


It all started with a website I created in September of 2005. At that time, the one and only topic was running. Truth be told, I was in it as much or more for the fun of learning to build and maintain a website than with any belief that I had something to say and that was worth writing about.

I was most interested in learning more about the technical side of this new thing (at that time anyway) called blogging and, to one degree or another, that has basically remained my focus over the years since. Without a doubt, anything I had to say and write about was secondary to the technical aspects of the website.

Years ago, I moved to WordPress and enjoyed the opportunity to gain exposure to a more diverse picture of blogging. Writing posts from my phone and entering the world of comments was new and exciting, but it didn't last very long. I missed the control I had over website design and decided to move back to building and maintaining a blogging website and expanding upon its offerings with a database and PHP managed comments that more resembled what I had observed in WordPress.

As I expanded the list of topics about which I was writing, I lost focus and with it any readership I had earned. As a result, I removed the technology I created for comments. My blog evolved to become a personal scrapbook and has pretty much remained in that category since. And, if I'm truly honest, I like this new paradigm.

I have no interest in monetizing the site (and thus turning it into a job) and I have no interest in attempting to build a readership that requires my participation. I enjoy the technology, the creativity, the artistic elements, and the writing. As for the social elements, I'll leave them to those who pursue that kind of thing.

From a technical standpoint, I'm quite happy to pioneer what has already been pioneered. I'm very comfortable rediscovering that which has already been discovered. And, I'm very much at home improving upon that which has already been improved.

Copyright © 2021 Hutch DeLoach

Search Archives