Welcome, Guest | Sign In

Submit - Cancel

Beginner Web Developer Mistakes

With my introduction into web development coming from a static html/css direction, I've had to overcome several bad coding habits over the years. Most of these started with poor assumptions about the way websites worked. It took a crash course in php programming and a few hard bumps before realizing how wrong my first websites really were. Here are a few of those assumptions and how I built on them to increase my programming skills.

Each URL relates to a unique file on a web server

If you're only used to working with static html files than this assumption is largely true. Every different URL that a user visits on a web page is in reference to a different file on the server. Without any type of scripting, the file is merely a chunck of html and can only be changed by a webmaster physically manipulating the document. My first dynamic website used php include commands to pull a fixed header and footer for all of my pages, allowing me to make global site changes from a single file. When I finally started to learn more about php variables and url manipulation, I kicked myself for the extra time and work I spent creating larger sites. There are a number of techniques that you can use to have a single script output multiple pages on a site, a concept I discussed with...

read more »

Website Overhaul

It may be no surprise to any of my long-term visitors, but I've decided to perform a deep overhaul of my website. Based partly on my recent introduction to model-view-control frameworks and partly on research into web caching and optimization, I've spent a good chunk of time analyzing my current and future website functions in the hopes of streamlining the backend code and optimizing the frontend. There are several goals that I have in mind for this overhaul, most of which will stretch my current programming skills.

Model-View-Controller Setup

The idea behind this sort of programming is breaking everything up into separate, reusable objects. All requests to the website are directed to a primary router, which interprets the request and pulls a controller to handle the page. A controller is a set of instructions based on the page type (example: home page, blog post pages, etc) that sets variables for the final page. The controller may talk to a model, which is the 'logic' for the site (usually a database object), and pull additional content for the page. Finally, views are included and passed variables to display a unique page per URL.

The benefits for this system are numerous - once the system is setup, that is. One database model can handle all SQL commands...

read more »

Dynamic Template Methods

Ever since I started working on websites during the summer of 2006 I made sure to keep dynamic and static information separate on my projects. Certain things in the website's content should remain the same, or similar, on separate pages: header, footer, navigation, etc. (I'll refer to these similar pieces as 'static' and the content that is unique to each page as 'dynamic'). However, when you work on a website with multiple pages, it becomes difficult to update the static information the same on all pages. This is where a templating system comes in handy.

A templating system allows the developer to separate the content to ease updating. When I first started with websites, I used Dreamweaver templates for this, which is a classic example of a templating system. You create a document in Dreamweaver with the header, footer, and any other information you want to remain the same across all the pages on your site and save it as a template. You can create new pages based on the template and Dreamweaver will 'lock' the template structure and only allow you to edit the dynamic, or unique, area of the page. If you want to change the static information, you can open the template separately, edit it, and save it. All of the pages created with the template will automatically update...

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 (mod rewrite style) and create the wire frame of my div layout, but I also took all of the unique content, including meta data and navbar, and put it in a separate file outside of my public_html folder. All of this is generated and...

read more »