UPS Rates and Services API and Spry

Two days in a row. This is the best I have done in a while. I’m not sure what you will be most excited about today, whether it’s going to be for showing you how to use the UPS Rates and Services API, or whether it’s using Spry to do it in real-time, or whether it’s the fact that my stuff makes you smile. Anyways, here is a link to a working sample of my Spry’d UPS Rates and Service API form.

The Problem:
Too often checkout pages are too many steps and too long. Without me getting into it personally, I will give you a tip that will make your online stores more successful: Limit the checkout process to one page. Recently I had a client I built a custom shopping cart for. She didn’t need a robust system like Os Commerce or Zen Cart, so I built one in from scratch. When I came to building the checkout page, I kept asking myself “how can I make this easier for the front-end user”. After fitting everything into one page, and realizing I could use Spry to get shipping rates RIGHT after they put in their zip, I knew I was on my way to land a home run.

The Solution:
I guess there are two parts to this one. The first is how the freak do I use the UPS API of which they supply close to 70 pages of documentation? Well, first off read this article and download his code. I am not going to take credit in creating the function I use. He also takes you through what you need to do on the UPS website, how to configure his script, and how to use his function.

Mark’s script however, simply returns one rate. I wanted to create a way to display several rate options to my customer. You can see what I did on the example page, below the form. So basically, I create an array with all of the shipping options I want to display. Then I run a foreach statement, to read the array one by one and complete Mark’s function. Each one returns a result that I can then display back to the user. However, I added in a radio button for each one, as well as the name of the shipping method next to it with the returned price from the API.

The next step was to integrate it using Spry’s updateContent utility. Like I showed yesterday this is fairly simple. I use the “onblur” handler again for their zip code, and place the zip code as the second input box to give it some time to load. Here is the “checkShipping” function that is called:

var checkShipping = function () {
//get their zip from the ship_zip box
var zip = document.shipping.ship_zip.value;
document.getElementById("Rates").innerHTML="Loading shipping options for Zip: " + zip + " ...";
//only check the zip if it's more than 4 characters
if(zip.length > 4) {
window.Spry.Utils.updateContent('Rates', 'getUps.php?zip=' + zip);
}
}

It’s pretty simple. Basically I get the value of their zip, and then display some temporary data into my loading div, to alert the user that something is coming. Then I check that their zip is more than 4 characters, and then I use my getUps.php script to retrieve the info. I pass that same zip variable that is being used to show the customer I am retrieving info for that zip, into the php script and then into the function to be used in calculating shipments.

As always, I am sure you are already thinking of ways to extend this further. Better validation maybe? Using sessions to remember their selection and display it if they have to come back and edit the page again? Maybe putting an awesome animated gif of a flying eagle above the form? Hopefully this will help you on your journey, and you won’t be forced to use OS Commerce or Zen Cart just because they have a plugin that does this same thing.

Stay tuned tomorrow as I discuss how Spry can be used to display very nice alert messages. I might even wrap it up into a PHP class.

Posted in Code, Featured | Tagged , , | 5 Comments

Spry week intro and login example

I have committed many times to be more active in being a more active “blogger”. Some of my posts have been very successful, like “Fighting Spam With CSS” and “Tweak that Gamma“. Also, with being featured on Elance.com recently about wordpress blogs, I have decided to recommit. My new approach, and hopefully this works, is choosing a topic to cover each week. Each day (M-F) I will demonstrate a small example within that topic, that will hopefully be beneficial to you.

This week is Spry.
You can follow the link to learn more about it, but basically it’s another javascript library created by Adobe. Some things I like about it, is 1. It’s completely free (no donations requested from a large company like Adobe); 2. It’s easy to impliment and use; 3. Their examples are really good and cover a wide variety of topics.

Recently, with a large project I have been working on, Spry has been very important in helping me use AJAX to enhance functionality and user-interaction. Recently, I created the registration pages for this same project. I wanted to make it as simple as possible. So for today, I am going to cover how to use Spry’s updateContent utility, to help me out with user login id’s.

The problem:
Like many sites where a login id is required, it can be frustrating once thousands of users are populating the database, to find a unique login id that hasn’t been taken. I am sure you can share my frustration with trying to create a unique account in Xbox live or yahoo chat. On many websites, the user types in their desire username, selects and confirms their password, and then clicks submit. The form then passes the information to a server-side script which checks the database to see if it’s unique, and then either sends back the form with a very disappointing error, or sends a very gratifying page that says “sexyMomma2007″ is available. When the user id is not unique, it can be frustrating. However, when a user has to continually try new ones and resubmit the form, then wait for a response from the server, that only builds on the frustration… until finally the user snaps and chooses a login that makes no sense and forever will be dissapointing.

The solution:
With this in mind, I thought to myself “Is there anything that can be done. Is there any hope”. Then I remembered the new buzzword “Ajax”, and realized, yes… There is a solution. Why don’t you take a look (I hate it when tutorials only put the finished link at the bottom… if you know enough about how it works just by looking at the code, then copy and paste the freaking code and use it in your own site. If you need more love, keep reading).

The instructions are there, but basically put in a username in the “Create login” box, and then click on the password box. You will then see a response of whether it’s ok or not. Also, you will notice if the username is taken, the “register” button becomes disabled, as another reminder they should try another name to continue. You will be happy to know that only 3 usernames are taken on this example: admin (me), modernblue (me), ferris-bueller (me, I wish). So, get some gratification by typing in your favorite user names and obtaining the best response you’ve had in weeks.

Where does spry come in?
First off, I include the spry script (spryData.js) between the <head> tags. Then, I call sprys “updateContent” function using only one line of code. Let’s look at my full function — read the comments:


var checkLogin = function () {
//get the value of their login name
var login = document.user.login.value;
//check the db to see if its available
window.Spry.Utils.updateContent('response', 'checkLogin.php?login=' + login);
}

The “checkLogin” function is the function I call with the “onblur” handler on my input text field. “onblur” is triggered when your cursor first enters the field, and then is clicked somewhere else (focus->blur). So simply, I get their awesome login name, then via spry, I load my “checkLogin.php” script (which you can see below the example) to see if a username is taken. I then pass the variable into my php script, in this case check an array of usernames (I know many of you are rolling your eyes bc I am using an array, rather than a MySQL “SELECT” statement), and then display the response based on it’s availability. I then call the valid login function, which then checks to see whether the response was available, or taken. Let’s take a look at this function:


//check to see if the username is unique
var validLogin = function () {
//get the class of the response span
var answer = document.getElementById('response').className;
if(answer != "success") {
//change the background of the text box to red
document.getElementById('login').className = 'sorryBg';
//disable the register button
document.user.register.disabled=true;
} else {
//change the background of the text box to green
document.getElementById('login').className = 'successBg';
//enable the register button
document.user.register.disabled=false;
}
}

Simply, this login checks the class name of the returned span I sent from my “checkLogin.php” script. If the class is not “success”, I assign the input box the class of “sorryBg”, which makes the background color of the input box red (international error color), and I also disable the register button for people who don’t notice the obvious red box and red error letters. If the class is “success”, then I assign the input box the class of “successBg”, which makes the background green, as well as enable the register button.

Any other ideas?
Of course with this example I am only touching the surface of using spry within forms. I would suggest using a javascript function to make sure the username is the required length, and has the required characters of for your application. Also, don’t forget everything you do user-side, should be re-validated server-side. I am sure some are rolling their eyes, but when you are doing a site for a client whose users are un-trusting (won’t have javascript enabled) you need to accommodate to them. For that same reason you should also accommodate to users who would always have javascript enabled, and especially want to have a quick and easy process. I would recommend looking at this page as well, to learn about Sprys very cool form validation methods.

What’s up for tomorrow?
I am going to share another example of using Spry.Utils.updateContent to show your users shipping rates based on their zip. I am guessing some of you are already starting to think of how this could be handled. I am also going to include a really simple function for connecting to the UPS api, to get immediate quotes.

If any of you need a little more help explanation, let me know via comments. I will try and help the best I can. And please, remember I left out a lot of things for brevity sake, so please keep comments about validation, compliance, security and politics to yourself.

Posted in Code, Featured | Tagged , , | 2 Comments

Patrick Bennett featured on Elance for WordPress Tips

Elance recently asked me to write an article about creating a successful WordPress blog. Read my WordPress Tips article.

Posted in Corporate News, Design Strategies, Featured | Leave a comment

Braintree Payment Solutions comes through

I recently made the switch to Braintree from Paypal to process my credit card payments, and I couldn’t be happier.

I was very impressed with the ease of integration. In about 1 hour, I set up a simple PHP script that allows my clients to pay invoices online. Paypal for the same thing took about 3 hours… to read through their complex documentation, decide which API method I wanted to use, and even a call into Customer Support for a common error you will find across Paypal’s customer support forums. Braintree gave me a PHP class that was ready to go. I only had to define my merchant info and get the values from my form and it was working great.

A really nice feature of their solutions is how they simplify PCI Compliance and eliminate my need to locally handle or store my customers credit card data – without using a hosted page. I was also able to achieve compliance much faster and with less cost.

In stark contrast to other providers I spoke with, Braintree’s approach is honest and straightforward. They don’t hide fees behind teaser rates and everyone I’ve worked with there, from sales to support, has been extremely responsive and knowledgeable.

I am a developer that always likes to keep things simple. Through working closely with Braintree and using their product first hand, I have realized they are the same. I am thus sticking with Braintree for all of my credit card processing needs, and recommend them to all of my clients. It’s nice to find other companies as passionate about their industry as I am about mine.

Posted in Design Strategies, Featured | 1 Comment

Lets put the value back in web design

The demand for websites has never been higher. It seems like the internet boom of the late ninety’s is back, but more stable. People are lining up to have websites built by the masses, and thus design firms are increasingly finding ways to produce websites cheaper and faster. The true purpose of web design is being lost to myths and misrepresented claims. The weight web design once had is being lost to other terms such as SEO. Although there are more, I want to discuss a few myths that cause these problems, and my own experienced-based rebuttals.

Myth 1: As long as I have a lot of traffic, my design doesn’t matter

With the magic word “SEO” becoming the new internet gold rush, companies and individuals are increasingly believing that design doesn’t matter. As long as the herds of consumers are coming to their site, there is no need to worry about design research, color schemes, navigational structure, or usability. Before I am misunderstood, I am not bagging on SEO’s at all. My brother is a well-respected owner of 97thfloor, an SEO firm. Even he has told me that some of his clients would be better off having their website rebuilt or redesigned, to increase website conversion, before starting such a large marketing campaign. Every company, whether a mom and pop shop or Wal-Mart can benefit on a design that is created around conversion and the user experience. With that said, it is often that companies come to me and say “We have put a lot of money toward advertising, we rank high on Google, but we are not seeing the sales or conversion we had hoped for.” My reply, “Your design and user interface scream lack of money, lack of research, lack of care.” Web design isn’t a slipshod process. It isn’t just a matter of “getting something up”. It is much more than that.

Myth 2: Since web design involves programming, any firm can do the work I need.

A smart business would never allow a cousin, friend, acquaintance etc… to make important business decisions with lack of experience. However, people allow these same people to create their companies websites all the time to save a buck or two. How often have I had to redesign a site, a matter of weeks after their first round, because their first designer didn’t create what was needed. In these cases, they loose time (which is money) having to start from scratch and redevelop something new. This time by someone who knows what they are doing. With how important the internet is these days, companies have to pick design firms that are experienced in designs that create customers out of site visitors.

Myth 3: If I tell a web company my budget for design, they will up their price to match it.

This one happens frequently. I ask every potential client that comes to me, “What budget have you set aside for this project?” As I wrote in a previous article, if they don’t have a budget this is usually a red flag for me. This means that 1. They really haven’t sat down and thought how much energy, time and resources they want to put into their project, and 2. The company may hiding it to try and narrow down design firms based on how cheap they are, not by how well they can take their budget and turn it into something fantastic. I like companies to have a budget for two main reasons: 1. It tells me they are organized and serious about their project, which gets me more excited to be a part of it, and 2. I can give them options of what is possible to deliver within that budget. It may make more sense to break a project into phases and work on them as sequentially. So companies, please let us know you are serious by figuring out your budget before you expect design firms to seriously look at your project.

Basically, we design firms need to find new ways to show our clients that we are different then the run-of-the-mill firm, or their neice. We need to show them that our design will increase profits, help to magnify their brand, and improve their business as a whole. If we can somehow put the value back in web design, businesses will be happier having received a design that accentuates their goals… and true designers will be happy taking on projects of value, while being compensated for their time.

Posted in Design Strategies, Featured | 7 Comments

BlueHost is dead

Due to high demand, hosting companies are very prevalent. It can be tough to find a great hosting company. I use “Great ” meaning zero downtime, fantastic customer support, a simple admin UI, bandwidth to spare, proper CPU and RAM allocation to handle high traffic peaks (like front-page DIGG articles) etc… It’s sad to report that a company I thought was doing a good job in many of these aspects, is failing repeatedly. A little secret of my design firm: We don’t host our clients sites. Why? The hassle isn’t worth the money. We stick to what we do best, and to be honest I don’t want to hire a guy to take calls from clients who’s internet is down (which means it’s the hosts fault…) when they could call their hosts’ customer support line. Anyways, I would have to charge them much more than what is available just to handle costs of having someone manage client’s hosting accounts. Ok, now that the secret is out… for the last year or so we have sent most of our clients with low traffic and bandwidth demands to BlueHost. We always felt their customer support was very fast, their tools were easy to use, and they had great uptime. Unfortunately, it seems BlueHost has been growing too fast to keep up (aren’t they taking on 500 or so new clients per day!). Downtime is more frequent, traffic spikes shut the site down, small mySQL databases cause CPU overload warnings etc… BlueHost is dead. Over the last few weeks I have noticed that their downtime has increased. One day in particular a few weeks ago, I noticed one of my sites was down. I went to another one of my BlueHost-hosted sites and it was down too. So I went to the BlueHost server status page… down. Then the BlueHost home page… down!!! Their entire system, even the server which they run their own site was down. This happened for about 5 minutes before one-by-one they started coming back. A few months before that, I had a site holding a national windsurfing contest. People were accessing the site nation-wide to get real-time results. All of a sudden the site went down. I frantically called customer support. The problem? A server maintenance/upgrade. I asked why it was happening at 2 o’clock in the afternoon. Their reply: “Since our customers are international we do them sporadically”. (This is funny because the BlueHost office is about 10 minutes from my house). I asked why I wasn’t notified they were doing a server upgrade, and I can’t remember the answer because it definitely didn’t satisfy me. More recently (3 days ago) I added a site to BlueHost. It was running PHP and mySQL (BlueHost runs LAMP) . There was a table of listings in the db with about 129,000 entries. Although a large number, it is very minimal when it comes to mySQL. The table was indexed properly, optimized and in the PHP code my query wasn’t doing anything fancy with SQL functions. I was simply using AJAX to create drop downs based on “Select … WHERE” statements. This is one of the most fundamental queries. Anyways, as I was testing this I received a CPU high-load message on BlueHost, meaning I was using too much of the server’s CPU for my processing. Puzzled and thinking it was an error, I continued in testing, only to have the message reappear again and again. More tests, even while connected remotely using SQLyog, gave me a the same CPU high-load message, even if I ran any large select statements or exported the database for backup. So, needless to say in my opinion BlueHost is dead. With their huge affiliate kick-back and ever-increasing customer sign-ups they aren’t what they used to. So, I am moving on. Currently I have been pleased with Media Temple’s (gs) servers, and I like the option they have of running a separate mySQL box to cut down CPU usage. Last time I called Media Temple’s customer support, I was on hold for 37 minutes. Needless to say, I am still looking for the perfect hosting company… which with today’s demands may not exist. Farewell BlueHost… we had some good times together and it’s hard to let go. But in the interest of my client’s needs, it’s best if we just stay friends. Maybe for fun, post your favorite hosting company below.

Posted in Misc | 45 Comments

Accepting Applications

It’s an exciting time for us right now. With this last year being so good to us, it’s time to keep moving things forward. Right now we have our hands full and in looking to match the demand for our services, it’s time for us to grow.

So, formally, we are accepting applications for a full-time web designer position. Please only apply if you have the skills to develop websites like these:

www.utahweddings.com | www.braintreepaymentsolutions.com | www.97thfloor.com | www.calema.com | www.bluehouseskis.com

We will be most impressed with applicants that can bring the following skills to the table:

  • XHTML / CSS valid scripting
  • Javascript / Ajax general knowledge
  • Backend languages like PHP and MySql aren’t foreign to you
  • You are familiar with Flash and actionscript
  • WordPress and Os Commerce are your friends
  • You can create clean and beautiful designs for various industries
  • You are likeable, work hard, and love to better the web

Although we would like for you to be local (Utah) we have no problem having you telecommute if you knock our socks off. Keep in mind, we are NOT looking for a firm whether state-side or overseas to outsource to. We are looking for an individual that can make things happen. Please send a BRIEF resume with 5 of your best websites to jobs@modernbluedesign.com.

We look forward to viewing your work!

Patrick Bennett
President
Modern Blue

Posted in Corporate News, Featured | Leave a comment

Social Media Toolbar to help build accounts

Download SM
We are very excited today to be part of a release for a new Social Media toolbar for Firefox®. We have been working with a SEO firm 97thfloor.com to develop it. Today, they are launching the official release on their website. With the large release, this page is also another spot to download it.

Useage:
sm-shot
This toolbar allows you to quickly see if a particular web page has been submitted to other social media sites, namely Digg, Reddit, Stumbleupon, or del.icio.us. Also, when scanning those websites, you can see whether a story has been submitted or not. In this way you can easily see if top stories have been submitted to other sites — if not you can click on the logo in the toolbar which will take you to the necessary page to add it through your account. This will allow us all to build better accounts on all of the major social sites. Take a look at another screen shot:

Digg Screen Shot

Credits:
I would like to personally thank Charles Berube who did the most work on the project. He is an excellent programmer. Also, I want to thank the guys at 97thfloor.com for partnering with us to make this tool happen.

Posted in Corporate News, Featured | Leave a comment

97th Floor Redesign

Yesterday we were proud to re-launch the website for an SEO Firm. We worked closely with them to help re-work the design in a way that would allow them to “show” more how they are one of the best in the business. Also, we made the entire site dynamic, including the “words we rank” tag cloud and keywords, all site text and images, and client logo rotations.

97th Floor is actually my brother’s company. He has helped them become one of the most respected SEO firms in the business, with clients such as Omniture. So, needless to say this site and project was important to me. And although I will miss the old site, this new one has a lot of potential, is more flexible, and looks awesome.

97thFloor

Posted in Corporate News | 1 Comment

Valid CSS Forms

Nice looking forms always bring attention. It’s one of those extra miles a web designer doesn’t have to take. But whenever I see nice looking forms on websites I think, “This guy pays attention to details.”

Since the big push for “Web 2.0″ and “Valid” websites, there as been an increase in mirrored text effects, gradients, bevels, colors etc… however, on many of these websites the forms get passed up. Why? You will have to check with the web designer I guess.

Anyways, I took it upon myself this morning to develop a valid, beautiful, css form in under 10 minutes. I took me 12 minutes actually. In fact, it is taking me longer to write this article and link to the form then actually making the form. Anyways, take a look at these forms I whipped up: Form1 | Form2 Â Here is a preview one Form 2:

Form2

Form 1 could be used to collect more information then a normal contact form. For example you could ask for their personal details, then shipping info etc… Form 2 is a basic contact form that most sites need.

Feel free to take the code and customize it to fit your needs. Also, you will notice that the forms are pointing to “process.php”. Well, if you want to know what to put in that file to make it work, download it here.

So, hopefully this will help us all to create nice forms. All you need to do is follow my lead. Change the repeating background image in the css properties for <fieldset>, make some color adjustments to other properties, add some extra fields etc…

Happy Forming!

Posted in Design Strategies, Featured | 3 Comments

Webby Awards and Web Standards

Are designers and users supposed to care about validation? Should the push the W3C gives be interpreted as a standard or a suggestion? Should we consider “validating” our web sites a religion, or merely a good practice? These questions may sound familiar, as the web standards debates continue. Well, here is some more fuel to put on the fire.

Only 1 of the winning sites for the Webby Awards validates both for html and css.

The mission statement of the Webby Awards is: “The Webby Awards is the leading international award honoring excellence on the Internet.” So does excellence simply mean usability and design? Or is compliance to web standards a factor? Well, the data I took from their winners shows that web compliance IS NOT a factor in the judging. A few months ago, the winners of the 2007 Webby Awards were announced. Among them, are some very content-rich and aesthetically pleasing websites. I had some time this week, so I took a look at every winner. As a designer, I couldn’t help but to pull back the curtains and dive into the code. What I found was very interesting. The table I have at the bottom of this post shows the data I found.

What was interesting to me is some of the same errors were being repeated. Not using the “alt” attribute on images; not encoding ampersands; using attributes that weren’t supported by their chosen doc type. Many sites actually came close to validation, and if they would have taken 2 minutes they could have validated. On the other hand, there were many sites that had hundreds and a few sites even thousands of errors. Their road to validation would be much longer, however not impossible.

Well, take a look at the data and you decide. Should we all contact the Webby Awards and push for change? Should we let the Webby Awards be a standard for how we design? You decide.

Name html version Errors valid css comments
Green my Apple xhtml strict 52 yes Mostly involve image tags. Not closing them properly, using border=0. Also, flash plugin problems. Could be fixed using swfObject. And some link problems, using target=_blank, which they could have gotten away with if using xhtml transitional.
SaveTheInternet n/a – (used html 4.01 trans). 51 no – 1 error Flash plugin errors. Also forgetting to close tags. Not using css to align divs. Forgetting alt tags.
Electrolux Design Lab html trans 4.1 10 n/a Problems include table attributes that don’t apply to that doc type. Closing tags that aren’t open.
People’s Design Award xhtml trans 3 yes Forgot there alt tags
PoetryFoundation.org n/a – (used 4.01 trans) 99 no – 8 errors No Doc type. Using tables with attributes that don’t apply. Forgetting alt tags. Mixing ending div and table tags.
Dream It. Do It. Website n/a – (used 4.01 trans) 27 no – 1 No Doc type. Missing alt tags. Forgetting to use & instead of just & in dynamic urls.
Volvo C30 – A Product of Free Will xhtml 1.0 transitional 13 no – 1 Most of the problems lie with their calling of the javascript. Also some closing tags missed.
Yaris Virtual Test Drive n/a (used 4.01 trans) 6 yes Forgetting to use “type” attribute when calling javascript. Forgot alt tag. Problem with flash plugin code.
Zopa html 4.0 strict 37 no – 13 Problems with table and iframe attributes. Not using “alt” tags. Closing tags that aren’t open.
Bank of America Online Banking html 4.01 trans 12 yes Using body attributes that should be applide through CSS. Closing tags that aren’t open.
Philips Norelco Bodygroom n/a – xhtml trans 1.0 8 n/a Not using encoded ampersands. Calling script before heading declaration.
HowStuffWorks xhtml trans 1.0 231 12 Tags not being closed properly using: “/>”. Problems calling their javascript. Forgetting alt tags. Closing tags that aren’t open. Not using encoded ampersands.
NYTimes html 4.01 transitional 353 6 Problems all over the place. Images, call to scripts, ampersand encoding.
IKEA, Dream Kitchen n/a – html 4.01 trans used 15 2 Mostly flash, however problems with attributes in tables, flash plugin, and call to js.
Flickr html 4.01 18 3 Some end tag problems. Not using encoded ampersands. Why are they still using tables?
Last.fm xhtml 1.0 trans 29 26 Problems with forms and attributes given. Flash plugin. Calls to js.
Jonathan Yuen n/a – html 4.0 19 n/a Some end tags omitted. Some attributes named incorrectly. Should have used styles for a lot of attributes. No alt tags.
Adobe CS2.3 – The Creative Mind xhtml 1.0 strict 10 0 Couple tags out of place.Using “border” on image tag.
DealBook html 4.01 trans 196 0 Using a lot of attributes the doc type doesn’t allow. “alt” tags not being used. Url encoding issues.
Bannerblog htmo 4.01 trans 53 0 Closing tags that aren’t open. Attributes not supported by doc type — could have used css instead. Closing tags that aren’t open, ie “input”. Missing “alt” tags.
we make money not art xhtml strict 277 n/a Forgetting “/>” to close tags properly like “<img” or “<input”. Some “alt” tags missing. Duplicate classes called. Encoded urls missing.
TreeHugger.com html 4.01 trans 104 1 A lot of “alt” tags missing. Encoded url problems. Using tables.
Truthdig n/a – html 4.01 trans 58 2 Using attributes not supported by doc type. Missing “alt” tags. Using tables.
blip.tv xhtml 1.0 trans 19 42 Tags out of place. Tag endings omitted. Missing “alt” tags. Using tables.
Verizon Dave Matthews Band xhtml 1.0 13 10 Flash plugin problems as well as call to javascript.
Best Week Ever xhtml 1.0 trans 294 68 Re-using css Identifiers. A lot of encoded ampersand problems. Flash plugin issues. Tag placement not supported by doc type.
I spy with my little eye xhtml 1.0 1 0 All they had to do was make “onLoad” all lowercase.
Nothing But Nets html 4.01 strict 58 2 Using “target” in links. Problems with “alt” tags and “border” attribute on images.
PlayB3yond xhtml 1.0 trans 21 0 Omitted tags. Uppercase tags in places should be lowercase. Problem with calling javascript.
MOTOCOLORS n/a – html 4.01 used 5 0 Closed tag which wasn’t open. No doc type declared.
MGM Grand Hotel & Casino xhtml 1.0 trans 74 5 Capitalizing tags. Omitted closing tags. Using tables and align attributes. Alt tags missing.
Adobe Corporate Website xhtml 1.0 trans 15 106 Encoded url link problems.
Smithsonian Photography Initiative html 4.0 trans 36 1 Assigning attributes that don’t exist for doc type, ie “name” for images. Missing alt tags. Flash plugin issue.
Smithsonian Education html 4.0 trans 23 n/a Using tables. No styles. Could have solved many problems by using divs and css. Duplicate tags.
Army Strong Launch Site xhtml 1.0 trans 203 n/a Was really surprised to find this many errors, considering the site is flash. Still capitalized certain tags. Gave image tags unknown attributes. A lot of problems with there embeded javascript.
Monster Career Advice xhtml 1.0 trans 152 20 Assigned attributes that shouldn’t be with this doc type. Capitalized some tags. End tags for tags that don’t exist. Maybe they should use there own services to get a better coder.
Mercedes-Benz E-Class Experience Paris-Beijing html 4.0 trans 11 0 Used attributes that aren’t supported, and used some capitalized lettering. Non encoded ampersand use.
Lollapalooza xhtml 1.0 trans 14 0 Using uppercase tags, and attributes that aren’t supported. Also closing tags that aren’t open.
PBS KIDS Sprout–Sprout Diner n/a html 4.01 trans used 3 n/a No doc type. Tags out of place. Flash Website
GreatSchools xhtml 1.0 trans 0 5 I thought we had one, but there css didn’t validate. Used values and properties that don’t exist.
ZOOZOOM ‘The Original Online Glossy’ html 4.0 trans 8 n/a Closing tags that aren’t open. Using attributes that aren’t supported.
FabSugar.com xhtml 1.0 trans 1920 927 Nope, those aren’t dates. Tags out of place. Attributes that don’t exist. End tags for tags that aren’t open. Got lossed in their table soup.
The Wall Street Journal Online xhtml 1.0 trans 257 n/a Using attributes that aren’t supported. Closing tags that aren’t open. Non-encoded urls.
CNNMoney.com html 4.0 trans 137 8 Using attributes that aren’t supported. Closing tags that aren’t open. Re-using css id’s.
Altoids.com xhtml 1.0 strict 18 n/a Not ending meta tags correctly with “/>”. Unsupported tag attributes.
Burger King Whopperettes n/a n/a n/a Site is password protected now
Gamasutra n/a html 4.01 trans used 253 11 “alt” attributes for images not specified. Using attributes within tags that aren’t supported. Closing tags that aren’t open.
GameSpot xhtml 1.0 trans 799 27 Mostly encoded url problems. Problems with attributes that aren’t supported.
Boston’s Public Transportation System xhtml 1.0 strict 31 18 Re-using css id’s. Some tags out of place.
FactCheck html 4.01 trans 3 0 Some mixed up code with an anchor tag.
Yelp html 4.01 strict 0 0 Nice work.
CNET.com xhtml 1.0 trans 951 78 Some uppercase attributes. Using non-encoded URLs. Missing end tags.
That Guy xhtml 1.0 strict 4 0 Problem calling javascript. Non encoded urls.
WebMD xhtml 1.0 trans 101 35 Some tags out of place. Not specifying type of javascript. Missing or out of place end tags.
The Onion xhtml 1.0 trans 3 28 Javascript type not specified. Missing end tag. CSS properties that don’t exist.
eHealthInsurance html 4.01 trans 55 0 Missing “alt” tags. Unsupported attributes being used. End tags missing.
Progressive xhtml 1.0 trans 132 29 Not closing tags properly. Javascript problems. Using capitals in some tags/attributes.
CLEARIFICATION xthml 1.0 trans 4 0 Problems calling javascript. Missing “alt” attributes for images.
LawHelp.org html 4.0 trans 14 0 Attributes that should be literal. Missing javascript type. Using unsupported attributes.
FindLaw html 4.0 trans 65 4 Javascript type not specified. Missing “alt” attributes. Re-using tag IDs.
BP Carbon Footprint Calculator xhtml 1.0 trans 123 34 Attributes that should be literal. Unsupported attributes. Missing end tags.
DIYNetwork.com n/a – html 4.01 116 6 Attributes that aren’t supported. Javascript type missing. Alt tag problems. Non-encoded urls.
MediaStorm xhtml 1.0 trans 26 2 Using uppercase attributes and ones that aren’t supported.
Salon.com xhtml 1.0 trans 9 0 A view elements out of place. A problem with one of their links.
Pan’s Labyrinth xhtml 1.0 trans 0 0 Mostly flash.
The Dumpster xhtml 1.0 trans 3 0 “alt” attribute missing. Naming id’s improperly.
Mono No Aware xhtml 1.0 trans 19 0 Missing “alt” attributes. Some tags out of place. Non encoded urls. ID’s used twice.
BBC News html 4.0 trans 155 0 Using unsupported attributes. Closing tags that aren’t open. “alt” attributes missing. Non encoded urls.
guardian unlimited xhtml 1.0 strict 1202 0 A lot of non-encoded links. A few tags out of place.
NYTimes.com html 4.01 trans 289 6 Non-encoded links. Attributes that aren’t supported. Missing “alt” attribute.
Know Menopause html 4.01 trans 12 0 Mostly flash. Not linking to javascript source correctly.
NPR Podcasts xhtml 1.0 trans 101 1 “alt” attributes not specified. Attributes that are unsupported. Missing closing tags.
OpenSecrets n/a – html 4.01 trans 196 n/a Using tables for everything. Using unsupported attributes. Missing “alt” attributes.
BBC Radio 1 html 4.01 trans 61 0 Elements used that aren’t supported by the doc type. Attributes used that aren’t supported. Missing “alt” tags. Closing tags which aren’t open.
Yahoo Real Estate html 4.01 trans 104 210 “alt” attribute not specified. Unsupported attributes used. Closing tags that aren’t open.
Religion & Ethics Newsweekly html 4.01 trans 4 7 Closing tags that aren’t open. Javascript “type” attribute missing.
What Is Enlightenment? html 4.01 trans 69 2 Ending tags that aren’t open. Missing “alt” attributes. Non encoded urls.
Hard Rock Cafe xhtml 1.0 trans 112 17 Using attributes that aren’t supported. Missing “alt” attributes. Closing tags that aren’t open.
CafePress.com n/a – html 4.01 trans 80 8 No doc type. Unsupported attributes. Missing “alt” attributes. Closing tags that aren’t open. Missing javascript “type”.
HubbleSite xhtml 1.0 trans 20 4 All encoded link or script problems. Non existing properties for css.
LInkedIn html 4.01 trans 9 34 Encoded link problems. Unsupported attribute.
Gifts.com html 4.01 trans 66 9 Unsupported attribute types. Missing “alt” attributes.
Facebook xhtml 1.0 strict 9 18 Elements missing parent tags. “Name” attributes being used.
Manchester United xhtml 1.0 strict 146 7 Missing “/>” at the end of some tags. Missing “alt” attributes. Some end tags missing.
The Science of Sex xhtml 1.0 transitional 26 0 “alt” attribute missing. Problems with flash plugin.
Current TV xhtml 1.0 transitional 154 9 Missing “/>” at the end of some tags. Problems with ambersand encoding.
The Office xhtml 1.0 transitional 93 2 Unsupported attributes being used. “alt” attributes not specified. Closing tags missing.
YellowstonePark.com xhtml 1.0 transitional 34 1 Certain attributes capitalized. Closing tags missing. Unsupported attributes.
Wikitravel xhtml 1.0 transitional 0 1 CSS error, unrecognized value.
TripAdvisor n/a – html 4.01 trans used 127 9 Unsupported attributes. “alt” attributes not specified. Reused CSS ID’s.
Cute Overload xhtml 1.0 transitional 60 7 Unsupported attributes being used. “alt” attributes not specified. End tags missing.

NOTE: I omitted some flash sites where validation didn’t really matter. Also, there may have been a couple I missed. Also, these were the results I got when I checked validation, and by no means am I saying it is what you will get as well.

Maybe next week I will follow up with a version 2.0 that explains what they could have done to fix it.

If anyone wants help with validation, feel free to contact me. I would be happy to help!

Posted in Featured, Just Talk | 6 Comments

Fighting Spam with CSS

It can be very frustrating when you have a form on your site which has a good and useful purpose, but almost becomes obsolete because of relentless spamming. I had this problem a few months ago with my old site, and was thus forced to find a solution that was light-weight, easy to implement, and most importantly was effective. I decided to turn toward my friend CSS to help me out.

The idea here is setting up a form with a text field and via CSS making it invisible. Then, if a post is sent to a php script handling the request and that text box has information in it, that means a human didn’t fill it out, and the script is simply aborted.

Here is a simple example. You can view the actual page here.

THE FORM:

Here is the xhtml I am using for the form code:


<form action="process.php" method="post"> <fieldset>
<label>Name: </label>
<input name="name" type="text" />
<label>Email: </label>
<input name="email" type="text" />
<label>Comment: </label>
<input name="comments" type="text" /> <input class="special" name="info" type="text" /> <input type="submit" value="Send" /> </fieldset>
</form>

First, this is not a tutorial on making forms look nice, so don’t give me crap. Everything should be straightforward, however, you will notice after the comment text box, there is another text box with the name “info” and the class “special”. This is the spam fighter. I didn’t want to mess up the orientation of the form, so I didn’t put a break between the comments box and the spam box. I just put it at the end of the line. Real people won’t see it looking at the page, because I turned off the visibility in CSS:

THE STYLES:

[quickcode:noclick]
body {
line-height:35px;
font-family:Arial, Helvetica, sans-serif;
color:#333;
font-size:14px;
}
.special {
display:none;
}
[/quickcode]

Really, the only class you need to look into is called “special”. Basically, I made it really small, again to avoid any design conflicts, and then I assigned the visibility property with the value “hidden”. This way, browsers don’t make it visible, and thus people can’t fill it in. However, when a spam scraper comes through the site, it’s going to read it and think it should be filled in — only to their surprise.

THE SCRIPT:

The php to handle this is very straightforward. Basically, you just look to see if that field has been filled in before it was posted, and if it was, you simply break the script so no email is sent, and tell the spammer to get lost. If it’s not filled in, then business as usual. To see this in action, fill out the top form and press “submit”. Then, fill out the bottom form including the spam box and press submit. Process.php returns different results based on what is typed in.

More Thoughts:

After doing this, my spam levels from form submission went down to zero. You could always add a function to search for html in the post as an extra caution as well. It just made me realize once more how important CSS is to making things work right. So in this case, CSS is my weapon of choice. I recently implemented this on my Orlando Florida Used Cars and Utah used cars website. It’s also working great for Doug Bennett Magic and Consumer Credit Repair Agency.

Another interesting article:
For those of you tired of gamma not showing correctly for images in PNG format, this awesome fix is for you.

Posted in Design Strategies, Featured | 149 Comments

Tweak that gamma

One of the frustrations of using the image compression (.png format), is the problems it can have with IE 6, 7. For those of use that like to use transparencies in png images for example, know that we have to find a png IE 6 transparency fix, if we want them to work in IE 6. Fortunately, Microsoft was somewhat on the ball with the release of IE 7, because it now supports png transparencies. However, in creating some web pages where I was using a png next to a jpg with what I thought to have the same background color, IE 7 for some reason made the png darker. Although it was ok in Firefox, this is frustrating for cross-browser debugging. This discrepancy is due to a way IE 7 reads the png file information.

When you compress an image in Photshop as a png format, the gamma information related to it is saved within the file information. When taking advantage of transparencies within the png format, this data has to be removed in order to work correctly in IE 7. So how do you do this? TweakPNG.

First, download the program. It’s standalone, so you won’t need to install anything. Open the program and drag your problematic png into the window of it. You will then be shown some options that will look like this:

TweakPNG

If you look on the left in the “Chunk” column, you will see a “gAMA” property. All you have to do is click on it, and press Delete. While you are in there, you might as well save a little bit of space by deleting the “tEXt” field as well, which only contains data of where the png was created, in this case Adobe Image Ready. Then click on “File -> Save” in the menu at the top, and re-upload your png, test it in IE7, and you should be good to go.

Although this can be a hassle, you should realize you don’t have to do this to every png you create. The problems occur when a png and jpeg or gif that need to match colors are close together. For many sites I do, I never use it because I am able to use images all on png format. But, it does come in handy when something needs to be done.

For more information about the png format, and how it is recommended by Wc3, click here.

Posted in Design Strategies, Featured | 16 Comments