Pig Work

Pig Work skip to main content

Weblog of Freelance Designer Steven Clark


PHP’s Location and Refresh

Filed under: — 11:06 am

Programming with PHP to create dynamic pages is a necessary skill for any web developer and I’ve long believed the day of the HTML static page is numbered in the very small zeros. People want dynamic websites that actually allow them to fulfil functions and not the plain ad-hoc pages put up by rote as budget solutions. The designer should be identifying stuff users will want to do on the site, assessing how transactions and interactions can be streamlined and made more usable and interesting for them. Of course there’s other technologies like ASP for developing dynamic content too but for this article I’ll stick to mentioning PHP.

One of the most important things to understand is the HTTP protocol even if its only on a basic level. Its a stateless protocol meaning it has no memory once it leaves the page, and HTTP works by sending requests and responses to and from the server for content. These HTTP transactions therefore contain request and response headers. PHP scripts can send HTTP response headers using the header() function.

It should be noted at this point that header must be called before any other output is sent to the browser or you’ll get a world full of kick arse error in your face. That’s strictly not a DTD or an invisible character or any output whatsoever and its one of the major forum questions for new PHP developers wanting to know why their page isn’t working.

There are a number of headers you can send but the one’s I’m concerned with today are quite useful to note. The first is the location header which allows you to redirect the page in your programming conditionals, such as if the user does this action send them to that page but if they do another then send them to the alternate page. Or you can simply use the location header to redirect users as a control mechanism. The format for this is in the following example:

header("location: pagetogoto.php");

Similarly the refresh header forces the browser to reload a new page after a set interval of time. The format for this is in the following example:

header("refresh: 5; url=pagetogoto.php");

Its really pretty simple stuff but also quite useful, just remember its kind of pointless putting HTML on a page with the location header but kind of useful with the refresh header. I tend to use the refresh header to create a graceful thankyou message after contact form submissions, for example. And the location header is handy to peel off different pages to successful submissions and failed submissions, each of which redirect the user to separate destinations - success to the home page and failure back to the contact form.


Should You Be Podcasting?

Filed under: — 12:40 pm

What is podcasting and why have we been hearing so much about podcasting in the recent past? What can podcasting do? Why have I used podcasting in several sentences and not just used the ‘it’ word? Is podcasting something you even need to know about? Well yes to the last one and I’ll explain something about the rest in turn.

First, I mentioned podcasting over and over because I want you to remember it and not think of it as just another technical catch phrase. I don’t want you to dismiss it as superfluous trivia either because its a technology that’s going to change a lot of how we do things. Podcasting isn’t just about getting mp3s for your music collection.

Put simply when RSS became RSS 2 it provided the ability to include audio and video files into RSS feeds. Podcasting is the creation of an mp3 file that’s then made available with RSS 2. Its really as simple as that and some lateral thinking will no doubt come up with a gamut of applications you can put it to. With podcasts you can deliver you own radio show, its deliverable like all RSS at the users convenience and isn’t subject to the same laws that apply to real-time radio stations. The key is its easy to produce podcasts and they are available when users want to experience them - you just have to figure out how to make commercial profit from them with new business models.

In the bigger picture RSS and podcasting are changing the way we do business and how information and products are, or can be, delivered to our clients. Its a ‘user request’ and not a ‘company sent’ line of communication too which means you won’t be sending those unwanted emails out to people. Provide the RSS Reader and instructions how to install it and then point users to your RSS page. From then on the client has real time access to all of your product information via RSS and podcasts. Podcasting is just another dimension to the RSS experience.


Blogs as Business Strategy

Filed under: — 8:19 pm

As a near daily blogger (blogophile) and someone who enjoys some great Flash on broadband on occasion (vicarious Flashturbator) its not a surprise to anyone that I read a great many blogs on a daily basis (yes a bloody blogoholic). Its a way of building business and social relationships, it gives me a view of what’s hot and what’s not in the design world, it puts my finger on the real time daily pulse of a world community. But its also a business thing - we should probably all have blogs if only to bring business to the door.

Blogging’s becoming something CEOs are looking at more and more and recently Jeffrey Zeldman asked not only ’should every blog have a business’ but also ’should every business have a blog’? The short answer to both is yes you should, it should and we all should.

I recommend to clients now that they should consider having blog software integrated into their site design too. A blog, if used properly and with original content, offers the business a way of delivering updates and information via RSS and Atom feeds to a waiting world audience. Real time updates to a real audience and without the worry of invoking the wrath of the already over-spammed.

A sports shoe store, for example, could obviously blog their latest sale prices or offer ongoing information to athletes and enthusiasts. A kennel can offer support information for the welfare of dogs. Someone high up in Microsoft can offer the reasons why IE isn’t what we’d like. And they are real world blogs being done by the day. So you don’t have to be a genius to see the commercial value of endearing customer loyalty and pursuing those relationships. If you’re like me and run your blog and a business site they have the power to share an audience, as well. And Google loves dynamic fresh word meat more than anything I can think of (except maybe direct cash deposits of course).

Good blogs offer something unique to the author(s), something not borrowed or stolen. They’re created with enthusiasm and if you’re excited about it you can excite others, too. In fact last year blogging rose by 58% (even if the figures are a bit suspect due to the spam blogging phenomena). Real blogs not only offer a wealth of information and resources on about every subject known to man but they also have the potential to make you money, and make your business money.


Understanding White Space

Filed under: — 1:24 pm

The visual layout of a web page (or anything for that matter) can be dramatically altered for better or worse by the use of simple white space. Feared by many this misunderstood design element has suffered at the hands of village witch hunts for too long! OK that’s melodramatic, but you should maybe start looking at white space in a more educated and appreciative way as a visual tool. I’m not talking minimalism but rather appreciation of the effect on balance and how the eye is drawn to portions of a design simply by shifting the spaces between elements.

There are two kinds of white space I’d particularly like to point out - passive and active. While passive white space involves areas such as the outside of the page or empty areas that aren’t aiding in the design there’s also active white space which are those areas without content that actually aid in the design. Active white space can be used to structure the page, make it more readable and place emphasis on some areas over others in the design. Its a powerful and sometimes underappreciated tool.

Its also an interesting perspective shift when you’re designing something just to stand back and look at what isn’t there. While too little active whitespace will create a claustrophobic effect and drive visitors away so will too much or disproportionate amounts of emptiness. So, just as ships are said to have good lines I think so do good designs of any variety including the web. Aesthetically pleasing and balanced pages are going to be far more successful than those that pay no heed to white space at all.


Designers and Coders

Filed under: — 4:28 pm

Reading the Web Standards Group daily email digest the other day I was knocked over by a couple of simple questions from someone I consider far more knowledgable than myself at the whole web standards thing, whether that was just a biased impression I’d grown for no reason isn’t really clear. But this guy does know his stuff. The questions were - what are use cases?, and what is information architecture?

This is important because it defines where I see coders and designers parting ways. In fact web development covers a wide range of actual jobs and these are just 2 blurry lines that often shift back and forth. Its important because here is someone who is a great coder, he knows the specs backwards, is a great troubleshooter and problem solver and would be a fantastic team asset. But what does the designer do? Well maybe I should call him an information architect or at least say that information architect is a subset of the designer role. The designer is less interested in the nuances of actual code and doesn’t design within his capabilities. They will take all of the information and research and design the most effective user interface for the situation, and they are also problem solvers but of a different type.

I could ramble on about this no end and probably not everyone will agree with how I draw my blurry lines here. In Japan the web development project is clearly defined into a great many actual jobs. Myself, like a lot of people who do this, I’m a fence sitter in that I can code a bit but I’m primarily interested in design. I’d like to be the one doing the report, the investigation, the research into effectively achieving the organisational goals and objectives. I enjoy investigating the underlying information architecture to reveal a user centric view of the information and how it should relate.

So although they’re different they’re closely related by necessity in small business at least. And I only mention it as I was totally shocked someone I see as very adept in his field had not even heard of some very basic software engineering principles. It made me feel a little bit good to know that some of the things I say do actually make sense. My job after all is to make a successful site that gets used and makes money. Just a tad more to it than perfect code…


A Post-Mortem - Why They Never Got the Contract

Filed under: — 3:39 pm

A good 5 months ago I was informally asked for some advice on a project that would launch a national company involved in fuel transport onto the web. They were specifically looking to do the job right and wanted a company intranet / extranet set up for them. They emailed me as I had a contact there whose responsibility was actually this project with the question - we’ve got bids between $8,000 and $80,000 and what’s the difference? - so I sent them a bunch of information, recommended they contact the Web Standards Group for referrals, and they went off to choose their designer… so this is the story as this project nears completion.

The lady the Web Standards Group recommended came highly qualified but underprepared, the feedback is that she seemed to know her stuff but in her presentation she appeared to the corporate end of town to be unprepared and not someone they felt would work well within the corporation. They needed someone who they could rely on, they wanted a CMS that wasn’t free and which had support, and they wanted someone they could feel confident in bringing the job to a successful completion. So who got the job…

Well I’m not sure of the actual company but they won the $27,500 bid and are providing a CMS that meets the clients needs, they presented well on the day and knew what they could and couldn’t provide and were confident. Weekly meetings ensure that everyone involved in the project gets input and is heard, feedback is obviously important.

Its very unfortunate that the web standards lady who was very qualified didn’t get the job simply on presentation and the impression she’d made. Its highly unlikely you’ll find any company ready to risk that much money on another company that doesn’t portray professionalism. Not to be beastly to her by a long shot. I mean if you’re going to sell to corporate they’ll be more comfortable with someone who looks, acts and speaks on their level. Which is natural.