Opening a New Chapter of Hiking

I was soaked. It was mid-morning, and I was following Bluff Creek downstream trying to find Rock Bluff Falls. The rain had finally stopped a few hours ago, but the twelve hours before that had been a steady downpour. Now the sun was slowly heating the woods into a steaming sauna. Everything around me was dripping, each step stirring more mosquitos and raining more water down on me. One slow mile of wet, mud, and insects was all I could take. I turned back towards the road and my car.

My adventures in the Upper Peninsula of Michigan started just over three years ago. I was living in Houghton and had a simple plan - I wanted to visit every waterfall in the area. This definition was a bit fluid but enough to fill a solid ten months of exploring. Living and working in Houghton meant that I could easily hit up several falls on weekday evenings. Hiking three to four days a week got me in great shape, and the simple goal of finding and documenting waterfalls was enough to keep me moving.

Young Logan at Rice Lake

Young Logan at Rice Lake

Once I moved to ...

read more »

Basic Forms with PHP

HTML forms are a great way to collect information directly from your users. There are plenty of input options available, even for the most basic, non-javascript enhanced forms. This post will go over the steps for creating, validating, and handling an elementary contact form with PHP and HTML.

We'll have to make a few basic assumptions before beginning. First, we'll assume that the page the form is displayed on can be executed with PHP. This could mean that either the page has a 'php' extension or the web server is configured to run this file as PHP, regardless of the file extension. Second, we'll assume that there is no conversion tracking (that is, analytics tracking the number of page visits vs the number of form submissions). This will make our submit logic a bit simpler. Finally, we will not be doing any javascript or ajax trickery. All the fields and submit request are handled as browser defaults.

Our initial step involves setting up a basic html form. We'll be submitting via the 'post' method, which passes the form parameters ...

read more »

Connecting to a MySQL Database with PHP

Working directly with the database is something I rarely do any more with the applications I work with. Instead of creating a raw connection and pulling data directly, I usually utilize some sort of customized data layer. (If you don't know what a data layer is, imagine creating a PHP application with no queries. You still have data being pulled, usually from MySQL table, but the data storage and structure is kept independent of your application. When done correctly, this can help immensely with code cleanliness and development.) However, setting up a connection and pulling information is still an important skill set, so here is a post about the basics. If you're looking for information that is more basic than a PHP-MySQL connection, you can read my series on the basics of the SQL language.

There are several ways to connect to a table, but I'd highly recommend using the MySQL Improved Extension, or mysqli, as a simple but powerful way to connect to your MySQL ...

read more »

Intro to SQL Part C

While the last two posts focused heavily on theory and fundamentals of SQL it's time to start on the actual usage. There's a ton of good tutorials out there that skip right to the code, but as a young developer, I wasn't convinced that SQL was a worthwhile tool until I was forced to use it. I wanted to spend a good amount of time discussing the basics before jumping into some examples. If you're looking for more advanced and specific uses, I'd highly recommend checking out w3schools SQL tutorials.

As I introduced in my last post, an SQL table is a collection of unique rows. There are two primary things that you do with the data in a table - read and write. With the proper syntax, a hacker can write to your database, injecting into or deleting your data, so it's important to restrict the front end privileges and validate. That's a subject for a later post, though. Let's look at how you can read a table.

Reading from a table is also known as a 'select' statement, ...

read more »

Intro to SQL Part B

In my last post, I introduced some of the basic ideas of data storage and how I came to realize that SQL would be a great solution to my content handling problems. Now I'd like to walk through some of the more advanced concepts and start going through some basic uses. There's plenty of great tutorials out there if you'd like to take SQL to the next level (I'd recommend checking out w3schools), but I hope these posts make a great foundation for a starting developer.

An Excel workbook is a good way to picture a SQL database. A database is a collection of tables (one table per tab), with each table showing a different portion of the total content. Each table should be unique in most cases to avoid duplicating your data. The individual tables in the database have some constraints. Rows must have the same number of columns and identical column types. It's also a good idea to keep the columns simple. If you're saving numbers, then the column should ...

read more »

Intro to SQL Part A

I like to think of myself as a practical web developer. With no true formal training, most of what I use to make my web sites is self-taught. Instead of trying to apply what I learned in a classroom into an online project, I went out and learned what I needed to get a project done. This allowed me to enter the world of web programming slowly, gradually picking up additional techniques and languages as my web sites became more advanced. There has been more than once that this approach has made my life difficult, though, and SQL is one of the more blatant examples.

After I learned xHTML and CSS, I thought that I was set with web development. I could design and launch fully compliant sites, updating them as necessary with new content. Once a few months passed, though, I started to realize that there was a big difference between markup and content, and that the content (data) of a web site should be handled separately from the markup (html tags). By keeping my changing content hard-coded on the page, I was losing my old data and funneling all of ...

read more »

Modular Website Setup

After making several iterations of my personal site, I've finally found a php backend solution that has made me happy. While I have no doubt that I'll find a new system or methodology within the year that will warrent a complete redesign, my current setup is surprisingly simple and fun to play with.

As php is my primary coding language, I make it a personal goal to never use third party plug-ins. I often utilize jQuery or posted Javascript plug-ins in my work, mostly because working with Javascript and forcing it to work in every available browser can be excrutiating. I have never used Ignitor or Wordpress for a project and do not see the need for it in my near future. So, when I create new sites and applications, I might find myself copying some of my old code for a particular function, but often try to make it cleaner or more efficient during the development process.

When I tackled my personal site this time around, I tried to sketch out the data flow before coding. Not only did I want a central file to handle all web page requests ...

read more »

Why I Write Complaint Code

A few weeks back a colleague presented me with an interesting question. He works with an Oracle database and PL/SQL (a programming language deeply tied to Oracle) to create website applications. As he wasn't too familiar with HTML and other modern web content trends, he often ran into issues with different browsers. He used the w3c compliance test as part of his troubleshooting process but never understood what compliance was useful for, especially as his HTML, which would display and work properly, rarely passed the test.

To begin, the term 'compliant code' is thrown around quite a bit. I'm using it in this post to describe xHTML/HTML with no open tags, correct tag names, and no outdated coding techniques or methods. Also, I tend to keep CSS and Javascript in external scripts to make my code easier to read and update, but this is not necessary to pass the w3c compliance test.

I have always made my code compliant and leaned towards xHTML transitional or strict with my website ...

read more »

Waterfalls of the Keweenaw

After graduating from Michigan Tech, I started to realize just how much free time I was going to have after a normal work day. The month of May was a bit hectic; moving into a new house, starting a new job, and adopting an 8 week old puppy was enough to keep both Katie and I occupied, but when my birthday rolled around in early June, we were looking for something new and exciting to do. Remembering a fun adventure in the late summer of 2007, where Katie and I had gotten lost near Skanee looking for the Mouth of Huron and accidentally found Lower Silver Falls, we decided to check out waterfalls in the Keweenaw Peninsula for my 23rd birthday.

Researching for waterfalls to stop at became more difficult then I had originally planned for. Though I found several websites with information, I also found inconsistencies, confusing directions, and poor descriptions of Keweenaw waterfalls. We finally picked out a route that included three waterfalls and several other local attractions, including the Gay Bar and Mt. Horace Greeley. We set off early in the ...

read more »

Current Programming Languages

I started learning about web development during the summer of 2006 when I took an undergraduate course at Michigan Tech involving basic xHTML and CSS. My professor was very strict on certain coding points, such as using valid, clean xHTML and the separation of content and style, which I still practice with my current coding projects. xHTML is the background code for almost all web pages today, containing the words and structuring the page. CSS designs the page, giving it color, special fonts, and images.

With the basics under my belt, I created my first website for the Inter-Residence Hall Council, a governmental student organization that I presided over. The site was basic but well-structured, even if it had no dynamic content. It wasn't until the next summer that I started learning a new language, PHP, partially to make updating my websites easier and partially out of curiosity. PHP is a server side language that creates xHTML - like pulling information from a database to display on a webpage. I also got a new job as a graphic designer and ...

read more »