Fix HTML5 Validator Error “Bad value X-UA-Compatible for attribute http-equiv on element meta.”

If you are using the X-UA-Compatible meta tag, then you'll probably run into this error when attempting HTML5 validation at the W3C. It's common to use X-UA-Compatible to set Internet Explorer to edge mode (forcing the latest rendering engine), and to enable Google Chrome Frame for visitors with that IE plugin. To make the validation error go away (perhaps it is your only remaining error?), the meta tag can be removed and the value can be sent through the HTTP headers instead. Depending on the web technology you're using and your server settings, this can be done in different ways, and I thought it'd be a good idea to collect the syntax in one place...

Get the Thumbnails of a YouTube Video: Standard URL and File Names

All the different thumbnail sizes of a YouTube video are accessible from a standard format. All you need is the unique video ID (viewable in the URL of your video). Thumbnail Image Format: http://img.youtube.com/vi/THE-VIDEO-ID/FILENAME.jpg The file name depends on which thumbnail size you are looking for. There are several to choose from...

10 Yii 1.x Framework and MVC “Beginner” Questions & Problems Solved

Sometimes "experience" means all the little stuff that no one ever bothered to write down. Learning code through doing will lead you on a zig-zag path from one problem to the next, that is different per-project. In starting a big website made with Yii, having never touched the framework before, I took notes on some of the issues and questions that arose while developing...

Yii 1.x: Adding Title Tags, Meta Descriptions, and Other SEO-Related Tags

As a followup to my post about SEO-Friendly URLs using Yii, I figured I would post this function I created for displaying SEO-related tags in the layout.Using the Gii generator with the Yii Framework, a custom base controller is created that is a parent for the others. It already contained a property called pageTitle that was used in some of the views. I decided to keep this location and expand upon it by adding in some more properties related to search engine optimization, and then create a function to display the HTML...

Clean SEO-Friendly URLs for Yii 1.x Pages

Creating SEO-friendly permalinks for an application built using the Yii Framework was a multi-step process. I figured I would outline each part. First, you can use slugs to access your view actions with the help of an extension and entries to your urlManager. Removing "index.php" is as simple as adding a few htaccess rules and changing two options. To Force trailing slashes, some code can be added to your base controller. And lastly, to give yourself cleaner "/site/page/" URLs, some more entries can be added to your urlManager...

CSS Print Media Query

Using the @media rule in your CSS allows you to target different media types, and screen sizes, from a single stylesheet. Using media queries with max-widths is integral to the current push towards responsive design. This can also be used to create your print styles using @media print. You'll notice this used on modern base-templates such as the HTML5 BoilerPlate:

Yii 1.x Framework Intro: Starting a New Database-Driven Website

In creating my first Yii application, there were a few hurdles and stumbling blocks along the way. One of the first guides/tutorials that a new user to the Yii PHP framework is directed to is the "Creating Your First Yii Application" in the "Definitive Guide to Yii" . This is kind of a companion piece that has extra explanation, plus the first steps I made to start turning the example app (generated skeleton) into my custom web application.

Launching a Codeigniter v2 Site: Steps to Disable Database Errors

Turning off error reporting is often mentioned as a standard security precaution when switching to a production environment. After all, you don’t want those precious database table and field names out in the open, for sneaky little hobbitses to view. If someone is rummaging through your site, trying to find vulnerabilities, this severely limits the […]