Archive: Dynamic Pages

Adventures in Debugging CakePHP

The purpose of this blog is to share whatever wisdom I accumulate in my business with other freelance web developers. Normally that means looking back at my previous week and trying to identify what I wish someone had told me at the beginning of the week. I generalize that information so that it will be useful to a wider range of people. With this post, however, I feel the need to be extremely specific.

Read the rest of this entry »

All I Want For Christmas Is To Reach My Customers

I came across a post in my RSS feeds today that talked about saving money on Christmas cards for your clients by doing a custom design. That got me thinking. I wouldn’t normally use an e-card as communication with a customer. Because they require so little effort and are somewhat generic, they don’t convey that you’re-important-to-me message that I look for out of a holiday card to my customers.

What is an e-card, though? It’s just an email - or usually an email with a link to a web page. Why not create a new page on your web site that is a custom holiday card for your clients? It doesn’t take much programming for each of your clients to see a personalized message. This works for Christmas, birthdays, or any other day that’s worth celebrating. Since it is “home made” it has some of the charm and thought that a generic e-card lacks.

  1. You save on postage and printing costs
  2. You bring customers back to your web site to see what’s new.
  3. You provide a sample of a project that customers could use on their own sites.

More Impressions of CakePHP

A few weeks ago I wrote my early impressions of CakePHP. In this post I’ll share my thoughts on the mystical “bake” function, SEO-friendly URLs, and intuitive code.

Read the rest of this entry »

Early Impressions of CakePHP

This certainly isn’t a comprehensive review of CakePHP. I have a client that wants to use CakePHP so they can support it internally. I’ve just barely scratched the surface, but the whole point of Cake is to allow you to develop something useful on a very short learning curve. Since it is freely available, I thought I’d share my first outing with this rapid development framework for anyone on the fence about giving it a shot.

Read the rest of this entry »

Don’t Reinvent the Wheel

When I stop and think about it, I’m amazed at the number of talented code writers who freely share their work with the rest of the world. There are a lot of generous souls in the web design industry. If you want your web site to have a DHTML menu or a thumbnail gallery or a slideshow, you don’t need to start from scratch. It’s surprising how often someone has already been in your shoes and is willing to share the code they’ve already written

Read the rest of this entry »

Using an Index to Speed Up Your Database Queries

I almost didn’t write on this topic. There are a lot of people out there who know more about indexing than I do. The problem is all of the knowledge on the subject is being presented by and for database specialists. While their need is probably greater, I contend that web programmers who create dynamic sites need this information as well. So I’m going to share what I’ve learned to make my queries faster over the years. If there are any gaping holes of information, than hopefully those will get addressed in the comments.

An index is created on a particular table in your database. You specify one or more columns that you’d like included in the index, and the database then has a snapshot of what the table looks like when all the records are sorted on those columns. The idea is that the table will be able to return query results involving those columns more quickly. Here’s how it works.

Read the rest of this entry »

Defending Against SQL Injection Attacks

One of the most obvious vulnerabilities of web sites that interact with a database is the SQL injection attack. What’s that you ask? Suppose your site allows visitors to enter information that is used to generate a database query. A common example would be for the user to enter a password. A hacker will attempt to enter unexpected values that will cause unexpected SQL statements to be executed.

Read the rest of this entry »

10 Steps To Clean and Optimize Your Web Site’s Code

Most visitors to a web page will only see how it is displayed in their browser of choice. They don’t know (or care) how the code that generates that page appears. So why should we as developers care? Because we’ve been told it’s the right thing to do? Well, okay, I guess. If I’m going to spend the extra time required to write clean code, though; I’d like to know a good reason why. (In this post, I refer to clean code and optimized code interchangeably.)

Maybe I should start by asking what constitutes optimized code? I usually think of it as code that is executed quickly. It should use the least number of lines necessary to accomplish the task and be relatively easy to read and maintain. In practical terms optimizing your code usually involves removing any unnecessary fluff and organizing what’s left into an easily understandable format.

Read the rest of this entry »