Entries from October 2007 ↓

Halloween Hacks: 1337 Pumpkin Carving

Figured this year the porch needed something leet.

In the light...

Leet Coding Pumping Carving

1337 Pumpkin in action...

1337 Pumpkin in action

Happy Halloween Losers

Browser Statistics: Cheers to that sly fox

A beer to mozillaToday marks a day, the day Mozilla's Firefox takes on IE6 (Microsoft Internet Explorer 6). W3schools posted the statistics for September 2007: IE6 34.9% Firefox 35.4% IE7 20.8%. One year ago September 2006 Statistics had Firefox at 27.3% and IE6 at 55.6%. Why this is such a big deal, why does is call for a fresh cold one to be cracked and cheered to Mozilla? IE6 was released late August 2001 with partial support of CSS level 1. Cascading HTML Style Sheets (CSS) level 1 was finalized in December 1996 by the World Wide Web Consortium (W3C), CSS level 2 finalized November 1997. CSS allows web designers and coders to control a websites look across infinite pages with one file. The one file also saves download times and makes HTML easier to read for disabled users and search engines. All the beautiful sites and cool websites that are made without Flash use CSS in many ways. It took Microsoft 9 years to implement a browser (IE7) that supported CSS level 2 (CSS2). Until Mozilla started chipping user percentages away from Microsoft in 2003, Microsoft software was responsible for rendering 85% of all pages internet users browsed on the web.

Needless to say, web designers small and large have struggled to have all pages correctly render across all browsers (mozilla, safari, and internet explorers), there have been many hacks to fix IE rendering bugs. Hacks which were the last resort in the trick box of the developer after frustrating over single pixel lengths that destroyed layouts.

Why has Firefox surpassed IE6? Two main reasons: One, Firefox is customizable, more secure, and renders faster. Two, with the introduction to Windows Vista users are opening up new computers in IE7 or getting IE7 via windows update in Windows XP. IE7 is a much better browser than IE6 and supports CSS2. If Microsoft had only done this 5 years ago I wouldn't have to keep Windows XP installed with IE6 for debugging.

So today I crack open a cold one and salute the mighty developers at Mozilla that pushed Microsoft to get their shit together. I salute to the demise of IE6 and throw it back for less debugging headaches. Call your web dev buddies and hit the bar, see you there.

P.S. Respect to Netscape and Opera, but they haven't had the success in reaping up users like Firefox did.

PHP MySQL Count Query Using Where Clause

Here is an example of a function that was created to count the number of book spreads attached to a certain book number. The problem was there were more than one book number attached to a whole table of bookspreads. By using SQL COUNT and WHERE it is possible to find the total count of entries with the same field input.

$book // the book number i wanted to count if a spread was attached to it

function spreadcount($book){
$query = "SELECT COUNT(*) FROM table WHERE book={$book} ";
$result = mysql_query($query) or die(mysql_error());
echo mysql_result($result,0); // 0 pulls the first result which is our magic number.

}

Conjuncting Javascript Variables with Strings

To add a variable mid string in javscript use the plus operator ( + )
Example:

var page;
page = "50";
document.write("Delete Page " + page + "?");

or when used within a function

function confirmDelete(delUrl,page) {
if (confirm("Delete Page " + page + "?")) {
document.location = delUrl;
}
}