Archive: January, 2008

Accepting Online Payments

Why does anybody offer online payments? After all, there is a mark-up that takes money out of your pocket on every transaction. Unless it’s the only way you accept payments (which is true for some businesses), you’re complicating your accounting and business processes by adding another special case for how a payment is received.

Read the rest of this entry »

Startup Weekend

Today I registered for Startup Weekend. The premise is a bunch of adventurous people get together for a weekend. Provided only with facilities and internet connectivity, we’re given 52 hours to come up with an idea for a web site-based business and get it up and running. All the participants have an ownership share in the final product.

This type of event has occurred in various cities. (I’m signed up for the one in Bloomington, Indiana on February 8th.) From what I can tell, the events have had varying degrees of success. While my intent is to end the weekend with a functioning web site, that is not the only outcome that I would consider a success. I’m excited about the experience of being in a room full of people with a common objective and a sense of urgency.

I’ll post again after the weekend about how things went. If you are interested in this type of opportunity, the founders of Startup Weekend will host an event pretty much anywhere. All you need is enough people who are interested.

Leveraging Fresh, Original Content

One of the most difficult and valuable things to create on a web site is original content that is regularly updated. You can design a stylized layout that will draw visitors in, but if there isn’t relevant content that is regularly updated, visitors aren’t going to stay long. Yet most business owners did not start their business with the intent of becoming web authors. So most are resistant to the idea of committing to the ongoing task of creating content for the site. After all, how are they supposed to find time for that in the midst of running a business?

Read the rest of this entry »

Giving an Uploaded File a Unique Name in PHP

It’s been a while since I’ve done a technical post with code snippets, so I thought I’d share a function that I use at least every week. The majority of my work is with custom CMS or the occasional intranet. In both cases I’m regularly dealing with code where the visitor can upload files to the web site. Maybe it’s pictures or PDFs or something else entirely. In any case, I have a simple function that I use to make sure the filename is unique.

function uniqueName($folderpath,$filename) {
    $adjname = str_replace(” “,”_”,$filename);
    $fulldest = $folderpath.$adjname;
    $originaldest = $fulldest;
    for ($i=1; file_exists($fulldest); $i++) {
        $fulldest = str_replace(”.”,”$i.”,$originaldest);
    }
    return $fulldest;
}

If you tried to upload a file called filename.jpg to a directory where that name already exists, this function would return filename1.jpg.

Flaws: The immediate flaw that jumps out at me when I look at this function is that if someone had a filename with multiple periods, such as my.precious.file.jpg, the function would return my1.precious1.file1.jpg. Since the file names are usually just stored in a database for me, this hasn’t come up as a problem, but it’s something to be aware of.

Any readers our there want to offer their improved versions of this function?

Price Your Service Like a Product

Up until a few months ago, I always started from square one when I needed to create a quote for a client. I’d go through the requirements for the project and estimate how long each item would take. I’d estimate how much time I expected to spend communicating with the client based on what I had learned about them up to that point. In short I spent an awful lot of time trying to come up with a 100% accurate quote of what each project was going to cost me to create.

Read the rest of this entry »