Responsive Web Design and Duplicate URLs

Duplicate content is a well-known issue that members in the search engine optimization (SEO) and web development communities keep a close eye on. This issue can lower the relative value of a page in the eyes of search engines, due to their being multiple instances of the page's content. The address, or URL, of any page on the internet is meant to be a unique identifier for the page, and if there is an exact duplicate of that content located on a separate URLs than the pages are not as useful for end users. A great example of this is the www vs no-www duplication that many sites have... Both versions of the URL may render the same page. GET parameters, tailing slashes, and other types of dynamically generated pages can also generate duplicate content issues.

I wanted to address the opposite issue in this post. Duplicate content can be easily fixed using a variety of solutions, but there are other practices that are starting to pervade the web development community that could potentially confuse users and search engines alike. Let's call it ...

read more »

Best Practices in Development

Over the last few days I've been working on a relatively large change to my image linking logic. This change involved some reorganization on the server side, adding name-spacing, changing the url structure, and placing 301 redirects to all 1200+ of my photos. I made this update both in hopes of keeping some relative SEO content on the photos linked in my blog and because I wasn't happy with the original implementation (especially the data storage). This post isn't about the update, though. I wanted to talk a bit about some of the principles I used on this and other projects I work on.

Incremental Changes

This update was a rather large one to my engine. I needed to change more than just a few image links - I upgraded my entire image storage system to a relational setup. Eventually this will turn into a dedicated photography site (photos.jacobemerick.com, mayhaps). Trying to change everything and push it live at once would have been asking for disaster.

Instead I broke down this change into five steps. Each step could be tested ...

read more »

Levels of Impossibility

As a novice web developer I often thought that many site functionality ideas were impossible. Without experience or working knowledge of a variety of web languages even the most basic Javascript animations or ajax features throughout the internet lived in the realm of dark magic and mystery. Now, after years of developing web sites for clients, I understand much more of how things work, or at least how to duplicate it using more familiar technologies. When a client throws a unexpected feature request at me, I can normally figure out a way to add it into their project. However, I still believe that some things are 'impossible'... it's just a matter of how impossible they are.

Level 1: Truly, Undeniably Impossible

Even with all of the amazing things web developers can do these days we still have one solid restriction: the browser. A browser instance cannot affect other browser instance (unless they are linked). One domain cannot directly read another domain's cookies. Web sites cannot affect a user's computer unless the user allows it. ...

read more »

Popular Music Project

Over the last few months I've been working on a fun side project to display what music I've been listening to recently. I decided to break this information down by albums and number of songs played over a period of time. While the data itself is straightforward and could be displayed either as a list or table, I wanted to make something visually interesting that would show the most 'popular' albums in my library.

Note: you can view this project at Jake's popular music site.

Before I could get involved in the display I needed to find a way to grab the data. Luckily, last.fm has a solution for this. Using their 'scrobbler' media plug-in, I am able to upload my music plays from all of the different computers I use (desktop, laptop, work computer) to my profile. They also have an API that returns this information as an XML feed. I query this API with a daily cron to pull the most recent information to my database.

In order to make the display dynamic I needed to do some ...

read more »

Will (and should) Google Plus be The new Social Network?

With the advent of Google Plus a few weeks ago, I've found it interesting to compare the differences of the major 'social networks' out there in today's internet. There's been a lot of discussion out there on Facebook versus Google, but I don't think it's fair to compare only these two applications. After all, Twitter is a major player who's simplicity and wide range of possibilities that, in some regards, is something that Google Plus is also targeting.

To start out I'd like to share what my idea how today's internet is changing. For the longest time publishing content on the web and sharing it with the world was a fairly difficult process. Even with the advent of Yahoo! GeoCities, MySpace, and blogging networks, it was difficult to show your friends, families, or 'followers' (people who are interested in your content but may not be an acquaintance) without sending links with every update. There are a few things that helped with that (search engines to find, rss/notifications to update), but it was still a clunky process. Then there was ...

read more »

Why You Should Build Your Own Darn Framework (Usually)

I've always been a big fan of writing my own website frameworks. It's how I learned to code, writing and re-writing a specialized PHP framework in an iterative, agile-like development process. There have been times when I've worked within standard systems (Zend, Code Ignitor, Wordpress, etc) but I try to avoid them on personal projects. PHP has a lot of flexibility in terms of allowing a developer set their own standards and I have a very unique style and approach to custom projects that I bring to my code. Also, I have some issues with using a pre-built framework.

Too Much Functionality

Some frameworks are very abstracted out with functionality for multiple data source drivers and DOM helpers (cough cough Zend). While it is impressive how much thought went into these large, comprehensive frameworks, there is often far too much logic there for a standard web project. As an example, one of the previous systems I worked with (heavy-traffic, front-facing site) was based off of the Zend Framework. Each page load included over 300 scripts ...

read more »

Abstract Form Handling

I've already gone over some basic form handling and form best practices with my last few posts, but building with an object-orientated MVC starts to throw forms into a different light. It's very easy to abstract out forms with their repetitive logic patterns, something that I've recently done on one of my side projects. While I don't want to explain the code line-by-line, this post will go over some of the basic thought processes and steps I took to make my abstracted form handler.

Form Wrapper

The first logic I worked out was the definition of a form. To create each new form, I create a new class that is abstracting off a base pattern. Each form class defines form elements within a standard 'get' method. This way I can call on individual form elements easily or call the entire class to pull the whole form. Example...

read more »

Best Practices with Forms

The last post about PHP form handling (forms with php) focused on the basics - the HTML syntax and simple PHP necessary for an operating form. There were several pieces that I glossed over in the explanation for the setup of that form that I want to go over in more detail now. You can create a form using many different techniques... but some practices are better than others.

Use Standard Elements

By using Javascript or tweaking HTML elements you can create a working form without the standard form elements (input, textarea, checkbox, etc). Normal HTML form elements often have annoying default styles added to them by different browsers that may conflict with your design. While it may seem like a good idea to hack their behavior, there are two reasons why you shouldn't.

First, if you don't provide graceful degradation, there's a good chance that your tweaks may make your form unusable by more basic browsers and systems (like screen readers!). Second, users are used to certain ...

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 »