Wizards are we, when it comes to building a highly professional, impressive and extraordinary piece of blog. Today's blog is not just a personal diary, it is a showcase of your products, art or skills, a complete E-Commerce application and an extensive social networking utility. We build just the same!

We Build, Customize, Manage blogs which best serve your requirements.

Nick's Tips

No Fluff Selling

.

PremHeaven

Your Very Own-Site

Crazy Sports Chick

Thinking Sock

Scary Geek

No-Shirt Required

The Mind Forum

If You Use It - It Works

Del Re-Law Firm

Femme-Preneur

Femme-Preneur is a wordpress based membership website.

Advocate AutoClaims

Auto BodyShop Secrets

Aviation Earplugs

Bootcamp Sydney

Conrad Colman

Hospitalbag 4 U

Industrial Earplugs

In Earmonitors

Innovative Fertility

Sleeping Earplugs

Undress 4 Success

Motorsport Earplugs

Beauty School

Home Hair Highlights

A Mac OS X-style Dock In JavaScript

Author: admin

Apple’s Mac OS X operating system is renowned for its fluid graphical effects. One impressive feature is the dock’s ‘fish-eye’ effect, whereby icons expand and contract as the mouse moves over them. Achieving this effect in JavaScript is difficult, but the MacStyleDock function allows this feature to be implemented easily. An example is shown below (a larger demonstration is available on a separate page).

mac-dock1

Read the rest of this entry »

  • Share/Bookmark

BarackSlideshow – Lightweight slideshow script

Author: admin

I guess pretty much everyone has seen Barack Obama’s website by now, which is clearly one of the prettiest of all candidates we’ve heard of so far. Not only is it an example of state-of-the-art design, but it’s also nice to navigate and interact with.

The creation

I took my previous class (SlideList), and made a few changes here and there. It works with MooTools 1.2, and supports all kinds of shape transformations (top and left coordinates, and height and width properties), which means it can now be used with vertical, horizontal, or even irregular lists.

Read the rest of this entry »

  • Share/Bookmark

AJAX powered shopping cart

Author: admin

One of the innovations of the web is online shopping. It allows us to buy things without ever leaving the comfort of our homes. However, the most basic element of online shopping, the shopping cart, has not evolved much. In this tutorial, we’re going to make an AJAX powered shopping cart using PHP, jQuery, and a few nifty plugins.

Preface

The goal of this tutorial is to show you how to build an AJAX powered shopping cart. However, it will not be production ready. The back end requirements vary from site to site far too much to write an effective tutorial. Instead, we are going to focus on the AJAX parts. The back end code in this tutorial acts as scaffolding for us to build the AJAX functionality, however, it can be built off of to meet your own site’s requirements. In the last section, we’ll discuss some possible next steps to implementing this in your own websites.

The other thing to note is that this tutorial will not explain all the details. A firm grasp of HTML, CSS, and some basic PHP is expected. By basic I mean variables, arrays, control structures, and basic OOP. Some knowledge of Javascript is a plus. We’ll walk through and break down the trickier bits of PHP and Javascript, but will gloss over the basic stuff like CSS styling. Links to documentation and other relevant resources will be sprinkled throughout wherever relevant.

The final thing to note is that the order codes (or product codes) used in this tutorial are completely arbitrary.

The Demo

The demo page shows a few different ways our AJAX shopping cart can function. It should be noted that this is not a production ready shopping cart. Due to variability of the requirements from site to site, this tutorial will only cover building the skeleton while you will have to code in the details for retrieving product names, prices, and other data that might come from a database.

Step 1 – Downloading the scripts

We’re going to be using jQuery, the jQuery
color animations plugin
, and Thickbox. The color plugin extends jQuery to allow us to use jQuery to animate colors and Thickbox lets us create quick and easy modal windows.

Create a directory on your web server for the cart to live in. For this tutorial we’ll be using cart/. Substitute cart/ with the directory you are using on your server. Inside the cart/ directory create js/, css/, and images/ folders for storing your Javascript, CSS, and images.

Download the jQuery, color plugin, and Thickbox files and save them into the appropriate folders we just created in the cart/ directory. Make sure you download the uncompressed thickbox.js.

Your folder structure should look something like this. I have renamed some of the files but it should be pretty obvious what each one is.

cart/js/jquery-1.2.6.pack.js
cart/js/jquery.color.js
cart/js/thickbox.js
cart/css/thickbox.css
cart/images/loadingAnimation.gif
cart/images/macFFBgHack.png

Step 2 – Setup Thickbox

Since our folder structure is a little different from the default Thickbox one, we’re going to need to fix some of the paths referencing loadingAnimation.gif and macFFBgHack.png.

Open thickbox.js and you’ll see the following line of code after the comments (line 8):

var tb_pathToImage = "images/loadingAnimation.gif";

Change that to the following so it references the loadingAnimation.gif file correctly:

var tb_pathToImage = "../images/loadingAnimation.gif";

Next open up thickbox.css and find the line that says (line 37):

.TB_overlayMacFFBGHack {background: url(macFFBgHack.png) repeat;}

And change it to:

.TB_overlayMacFFBGHack {background: url(../images/macFFBgHack.png) repeat;}

Step 3 – The Shopping_Cart class

We will create a class to handle all the different actions such as adding items to the cart and saving the cart. The following is the code for the Shopping_Cart class we’ll be using for this tutorial. Again, this is very barebones intentionally because the backend requirements will be different from site to site. Since there isn’t much code, I will not explain each and every method and instead let the comments do the explaining. Save this as shopping_cart.class.php. We’ll take a look at how to use this class in the next step when we create a sample load script.

cart_name = $name;
		$this->items = $_SESSION[$this->cart_name];
	}

	/**
	 * setItemQuantity() - Set the quantity of an item.
	 *
	 * @param string $order_code The order code of the item.
	 * @param int $quantity The quantity.
	 */
	function setItemQuantity($order_code, $quantity) {
		$this->items[$order_code] = $quantity;
	}

	/**
	 * getItemPrice() - Get the price of an item.
	 *
	 * @param string $order_code The order code of the item.
	 * @return int The price.
	 */
	function getItemPrice($order_code) {
		// This is where the code taht retrieves prices
		// goes. We'll just say everything costs $9.99 for this tutorial.
		return 9.99;
	}

	/**
	 * getItemName() - Get the name of an item.
	 *
	 * @param string $order_code The order code of the item.
	 */
	function getItemName($order_code) {
		// This is where the code that retrieves product names
		// goes. We'll just return something generic for this tutorial.
		return 'My Product (' . $order_code . ')';
	}

	/**
	 * getItems() - Get all items.
	 *
	 * @return array The items.
	 */
	function getItems() {
		return $this->items;
	}

	/**
	 * hasItems() - Checks to see if there are items in the cart.
	 *
	 * @return bool True if there are items.
	 */
	function hasItems() {
		return (bool) $this->items;
	}

	/**
	 * getItemQuantity() - Get the quantity of an item in the cart.
	 *
	 * @param string $order_code The order code.
	 * @return int The quantity.
	 */
	function getItemQuantity($order_code) {
		return (int) $this->items[$order_code];
	}

	/**
	 * clean() - Cleanup the cart contents. If any items have a
	 *           quantity less than one, remove them.
	 */
	function clean() {
		foreach ( $this->items as $order_code=>$quantity ) {
			if ( $quantity < 1 )
				unset($this->items[$order_code]);
		}
	}

	/**
	 * save() - Saves the cart to a session variable.
	 */
	function save() {
		$this->clean();
		$_SESSION[$this->cart_name] = $this->items;
	}
}

?>

Step 4 – load.php

Before we do anything else, we’re going to create a simple script that loads some sample items into the cart. This will make building the actual cart page easier. Let’s name this file load.php and save it in the cart/ directory.

setItemQuantity('HSD-KSE', 2);
	$Cart->setItemQuantity('KLS-IEN', 1);
	$Cart->setItemQuantity('ELS-OWK', 4);

	$Cart->save();

	header('Location: cart.php');
?>

The first three lines include the shopping cart class we created in the previous step, start the session so we can save the cart, and create a new Shopping_Cart instance. These three lines will be at the top of any file that needs to access the shopping cart. Notice how on line 3 I pass a single parameter, ’shopping_cart’, when I create the Shopping_Cart instance. ’shopping_cart’ gets passed to the constructor of the class, which sets the instance variable $cart_name. This is the name of the session variable that we will be storing all the cart data. The reason we do this is to avoid conflicts with other carts.

The rest of the code simply adds three items to the cart, saves them, and redirects the user to the cart itself which we’ll be building in the next step. Methods (which are basically functions) in a class are accessed using a special arrow syntax.

Step 5 – Building the cart

We’re going to build the cart, but without the AJAX functionality first, so that in the event that the user has Javascript disabled, she will still be able to use the cart. This is important, because we want her to buy something and she won’t be able to do that if it doesn’t degrade well when Javascript is disabled!




	

		
		
		

	

	

Shopping Cart

hasItems() ) : ?>
getItems() as $order_code=>$quantity ) : $total_price += $quantity*$Cart->getItemPrice($order_code); ?> " : " "; ?>
Quantity Item Order Code Unit Price Total Remove
getItemName($order_code); ?> $getItemPrice($order_code); ?> $getItemPrice($order_code)*$quantity); ?>
$

You have no items in your cart. Load Sample Cart

Here we just show the items in the cart in a nicely formatted table with some form controls for removing items and changing the quantities. On line 18 we check to see if there are items in the cart. If there are, we go ahead and create the table. If not, we show a simple message letting the user know she doesn’t have any items in her cart. I’m using the alternative syntax for if…else statements.

This chunk of code might look intimidating but it’s pretty simple if we break it down:

getItems() as $order_code=>$quantity ) :
		$total_price += $quantity*$Cart->getItemPrice($order_code);
?>

	" : "
"; ?>


getItemName($order_code); ?>

$getItemPrice($order_code); ?>
$getItemPrice($order_code)*$quantity); ?>




First we set the total price ($total_price) and a row counting variable ($i) to 0. Then we dive into a foreach loop that creates a row in the table for each item. Here’s a run down of what happens inside the loop:

  1. Add the extended price (quantity * unit price) to the total price.
    $total_price += $quantity*$Cart->getItemPrice($order_code);
    1. Add the extended price (quantity * unit price) to the total price.

      $total_price += $quantity*$Cart->getItemPrice($order_code);
    2. Echo out the opening

      tag. If the row count is odd, include a class called “odd”. This is for the zebra striping that will make browsing the cart easier. Here we use the ternary operator (?:) as a shortcut to a full if…else statement.

      echo $i++%2==0 ? "
      " : "
      ";
    3. Echo out the input quantity field. The name of the input field is formatted (quantity[ORDER-CODE]) so PHP will automatically convert it into an array. We reuse the row count ($i) to add a tab index.

      
      
      
    4. Echo out the item name, order code, unit price, and extended price.

      getItemName($order_code); ?>
      
      $getItemPrice($order_code); ?>
      $getItemPrice($order_code)*$quantity); ?>
      
    5. Echo out the remove item checkbox. Notice again, the specially formatted name of the checkbox input element.

      
      
      
      
    Afer the foreach loop we echo out another row that shows the total price of all the items in the cart. I've also added a link to the load.php we created in the previous step so we can load in sample data for testing easily.

    Step 6 - Styling the cart

    The cart looks a little plain at the moment so lets give it some styling. Save the CSS code as cart.css in cart/css/ folder. This will give the cart some color and formatting so that it's easier on the eyes.
    body {
    	color: #222;
    	font: 0.8em Arial, Helvetica, sans-serif;
    }
    
    h1 {
    	font: 2em normal Arial, Helvetica, sans-serif;
    	margin-bottom: 0.5em;
    }
    
    #container {
    	margin: 0 auto;
    	width: 80%;
    }
    
    table#cart {
    	border-collapse: collapse;
    	margin-bottom: 1em;
    	width: 100%;
    }
    
    	table#cart th {
    		background: #006b68;
    		color: #fff;
    		text-align: left;
    		white-space: nowrap;
    	}
    
    	table#cart th,
    	table#cart td {
    		padding: 5px 10px;
    	}
    
    	table#cart .item_name {
    		width: 100%;
    	}
    
    	table#cart .quantity input {
    		text-align: center;
    	}
    
    	table#cart tr td {
    		background: #fff;
    	}
    
    	table#cart tr.odd td {
    		background: #eee;
    	}
    
    	.center {
    		text-align: center;
    	}

    Step 7 - Processing the cart

    getItemQuantity($_GET['order_code'])+$_GET['quantity'];
    	$Cart->setItemQuantity($_GET['order_code'], $quantity);
    }
    
    if ( !empty($_GET['quantity']) ) {
    	foreach ( $_GET['quantity'] as $order_code=>$quantity ) {
    		$Cart->setItemQuantity($order_code, $quantity);
    	}
    }
    
    if ( !empty($_GET['remove']) ) {
    	foreach ( $_GET['remove'] as $order_code ) {
    		$Cart->setItemQuantity($order_code, 0);
    	}
    }
    
    $Cart->save();
    
    header('Location: cart.php');
    
    ?>

    This is another fairly simple script. There are three if statements to check for adding items, setting quantities, and removing items. Here's where the special formatting on the input field names comes in play. PHP will automatically convert input field names with brackets into arrays. So if we do a var_dump() of $_GET on the update cart form submission, you might get something that looks like this:

    array(3) {
      ["quantity"]=>
      array(3) {
        ["HSD-KSE"]=>
        string(1) "2"
        ["KLS-IEN"]=>
        string(1) "1"
        ["KWL-JFE"]=>
        string(1) "9"
      }
      ["remove"]=>
      array(2) {
        [0]=>
        string(7) "KLS-IEN"
        [1]=>
        string(7) "KWL-JFE"
      }
      ["update"]=>
      string(11) "Update cart"
    }

    Since all the new quantities and items to be removed are in arrays, we can simply loop over them using a foreach loop and call the appropriate functions. The first if statement adds new items to the cart, the second changes item quantities, and the third removes items.

    At this point, we have a functioning shopping cart without the AJAX. Pretty boring so far, but we'll be adding in the AJAX in the next step.

    Step 8 - Adding AJAX

    The first thing we need to do is link jQuery, the color animation plugin, and our own javascript, which we will be creating in a little bit, to the cart. Open up cart.php again and add the following lines inside the tags.

    
    
    
    

    Now create a file called cart.js inside the cart/js/ folder. This is where we will be putting our own Javascript code that enables all the AJAX functionality. Inside it, add the following code.

    $(function() {
    	$("#cart tr .remove input").click(function() {
    		var orderCode = $(this).val();
    		$.ajax({
    			type: "GET",
    			url: "cart_action.php",
    			data: "remove[]=" + orderCode,
    			success: function() {
    				$("#cart tr .remove input[value=" + orderCode + "]").parent().parent().fadeOut(500, function() {
    					$(this).remove();
    					calcPrice();
    				});
    			},
    			error: function() {
    				window.location("cart_action.php?remove[]="+orderCode);
    			}
    		});
    	});
    
    	$("#cart tr .quantity input").change(function() {
    		var orderCode = $(this).attr("name").slice(9, -1);
    		var quantity = $(this).val();
    		$.ajax({
    			type: "GET",
    			url: "cart_action.php",
    			data: "quantity[" + orderCode + "]=" + quantity,
    			success: function() {
    				var startColor = $("#cart tr .quantity input[name*=" + orderCode + "]").parent().parent().hasClass("odd") ? "#eee" : "#fff";
    				$("#cart tr .quantity input[name*=" + orderCode + "]").parent().parent().find("td").animate({ backgroundColor: "#ff8" }, 100).animate({ backgroundColor: startColor }, 800);
    				calcPrice();
    			},
    			error: function() {
    				window.location("cart_action.php?quantity[" + orderCode + "]=" + quantity);
    			}
    		});
    	});
    });
    
    function calcPrice() {
    	var totalPrice = 0;
    	$("#cart tr .quantity").parent().each(function() {
    		var quantity = $(".quantity input", this).val();
    		var unitPrice = $(".unit_price", this).text().slice(1);
    		var extendedPrice = quantity*unitPrice;
    		totalPrice += extendedPrice;
    
    		$(".extended_price", this).html("$" + extendedPrice);
    		$("#total_price").html("$"+totalPrice);
    	});
    	if ( totalPrice == 0 ) {
    		$("#cart").parent().replaceWith("
    

    You have no items in your cart. "); } }

    This jumble of code looks rather intimidating too, but it can be divided into three distinct blocks: the block that handles the remove checkboxes, the block that handles the quantity fields, and the last block that recalculates all the prices when a an item is removed or a quantity is changed. The first two blocks are contained in a function that looks like this:

    $(function() {
    	// Code goes here...
    });

    Code that goes inside this function is executed once the DOM has been loaded. It's a shortcut to the $(document).ready(callback) function.

    The first block of code that goes inside that aforementioned function handles the remove checkboxes:

    $("#cart tr .remove input").click(function() {
    	var orderCode = $(this).val();
    	$.ajax({
    		type: "GET",
    		url: "cart_action.php",
    		data: "remove[]=" + orderCode,
    		success: function() {
    			$("#cart tr .remove input[value=" + orderCode + "]").parent().parent().fadeOut(500, function() {
    				$(this).remove();
    				calcPrice();
    			});
    		},
    		error: function() {
    			window.location("cart_action.php?remove[]="+orderCode);
    		}
    	});
    });

    This binds a function to the click event of all the checkboxes. When a checkbox is clicked, a couple things happen:

    1. Grab the order code and store it in a variable.

      var orderCode = $(this).val();
    2. Make an AJAX call to the server, telling it to remove the item. The data that is submitted is exactly the same as if we did a form submission. The data parameter is identical to the GET string we would see if we removed the redirect in cart_action.php and did an update cart form submission. If the AJAX call is successful, we fade out the row with the item we want to remove and then remove it completely from the DOM. Then we call the calcPrice() function (the third block of code) to recalculate all the prices. If the call was unsuccessful, we fallback to a page refresh.

    The second block of code is very similar except it sets the quantities:

    $("#cart tr .quantity input").change(function() {
    	var orderCode = $(this).attr("name").slice(9, -1);
    	var quantity = $(this).val();
    	$.ajax({
    		type: "GET",
    		url: "cart_action.php",
    		data: "quantity[" + orderCode + "]=" + quantity,
    		success: function() {
    			var startColor = $("#cart tr .quantity input[name*=" + orderCode + "]").parent().parent().hasClass("odd") ? "#eee" : "#fff";
    			$("#cart tr .quantity input[name*=" + orderCode + "]").parent().parent().find("td").animate({ backgroundColor: "#ff8" }, 100).animate({ backgroundColor: startColor }, 800);
    			calcPrice();
    		},
    		error: function() {
    			window.location("cart_action.php?quantity[" + orderCode + "]=" + quantity);
    		}
    	});
    });

    Here we bind a function to the change event of all the quantity input fields that will execute an AJAX call whenever the quantities are changed. Let's break it down:

    1. Retrieve and store the order code and the new quantity.

      var orderCode = $(this).attr("name").slice(9, -1);
      var quantity = $(this).val();
    2. Make an AJAX call to the server telling it to update the specified quantity. If the call is successful, we make the background color of the row "blink" yellow for a second to let the user know the quantity has been changed, then call the calcPrice() function to recalculate all the prices. If the call is unsuccessful, fall back to a page refresh.

    And finally the third block of code, which we've seen been called twice already: the calcPrice() function.

    function calcPrice() {
    	var totalPrice = 0;
    	$("#cart tr .quantity").parent().each(function() {
    		var quantity = $(".quantity input", this).val();
    		var unitPrice = $(".unit_price", this).text().slice(1);
    		var extendedPrice = quantity*unitPrice;
    		totalPrice += extendedPrice;
    
    		$(".extended_price", this).html("$" + extendedPrice);
    		$("#total_price").html("$"+totalPrice);
    	});
    	if ( totalPrice == 0 ) {
    		$("#cart").parent().replaceWith("
    

    You have no items in your cart. "); } }

    This is simple as well. We loop through each row and recalculate the extended price and total price. Let's break it down what happens inside each loop:

    1. First retrieve the quantity and unit price of the item and multiply them to get the extended price. Then add it to the running total price which starts at zero.

      var quantity = $(".quantity input", this).val();
      var unitPrice = $(".unit_price", this).text().slice(1);
      var extendedPrice = quantity*unitPrice;
      totalPrice += extendedPrice;
    2. Update the extended price for the current row and the total price with the running total.

      $(".extended_price", this).html("$" + extendedPrice);
      $("#total_price").html("$"+totalPrice);
    3. If after we finish looping through the columns we find that all the items have been removed, replace the cart view with a message saying the cart is empty.

      if ( totalPrice == 0 ) {
      	$("#cart").parent().replaceWith("
      

      You have no items in your cart. "); }

    One thing to note is the selector I use to retrieve the rows in the table. I select all the table cells with the class of "quantity" and then call the parent() function to get the rows. This is because the table headers are also stored in a row. If we simply used "#cart tr", we would get the table headers as well.

    Step 9 - "Add to cart"

    No cart is complete without a way to add new items to the cart, so we're going to create an index page that shows off two different ways you can do just that. While we're at it, we're going to enable Thickbox so that the cart opens up in a modal window rather than going to a new page.

    Let's create the page and then break it down. Save the following as index.html in the cart/ folder.

    
    
    	
    
    		
    		
    		
    		
    
    
    
    		
    
    	
    
    	
    

    Shopping Cart Demo

    Open Cart
    Add three KWL-JFE to cart

    If you take a look at the code between the tags you'll notice I've included two more files, thickbox.js and thickbox.css, and added some more Javascript. Let's talk about the Thickbox bits first.

    Thickbox converts links with a class of "thickbox" into a link that opens up in a modal window. The different options for the modal window are defined in the GET string of the URL. The different options are detailed in the examples section of the Thickbox site. For our shopping cart, we are interested in opening iFramed content in a modal window.

    To open iFrame content we use the following parameters in the URL:

    ?KeepThis=true&TB_iframe=true&height=400&width=600

    The first two parameters, KeepThis and TB_iframe, are constant but the other two define the height and width of the modal window. We'll make ours 780px wide and 400px tall. Our open cart link will look like this (don't forget to set the class to "thickbox" or it won't work!):

    Open Cart

    Another thing to note is that the title attribute of the link will be displayed as the title of the modal window.

    The next link will add an item to the cart in addition to opening it. To do this we have to pass two more parameters in the GET query string: order_code and quantity. However, these two parameters need to come before the KeepThis parameter in the query--Thickbox automatically removes all parameters after the KeepThis parameter. The URL should look something like this:

    cart_action.php?order_code=KWL-JFE&quantity=1&TB_iframe=true&height=400&width=780

    This URL will add a single item with the order code of KWL-JFE. The cart_action.php script we wrote previously will look for the order code and quantity parameters and add them to the cart accordingly.

    The second way we can add items to the cart is by form that lets the user specify the quantity. However, since we want the cart to open up in a Thickbox, we have to use a bit of Javascript. Between the tags you'll notice we have some Javascript that executes once the DOM has been loaded:

    This code looks for forms with a class of "cart_form" and binds a function to the submit event. The handler can be broken down as follows:

    1. Set the title of the window and get the order code and quantity from the form fields.
    2. Build a URL with order_code, quantity, and the Thickbox parameters.
    3. Open a Thickbox modal window.
    4. Return false to stop the form submission.

    Finally, we'll add a little bit of CSS to give it some style. Save the following code as style.css in the cart/css/ folder.

    body {
    	color: #222;
    	font: 0.8em Arial, Helvetica, sans-serif;
    }
    
    h1 {
    	font: 2em normal Arial, Helvetica, sans-serif;
    	margin-bottom: 0.5em;
    }
    
    #container {
    	margin: 0 auto;
    	width: 80%;
    }
    
    table#cart {
    	border-collapse: collapse;
    	margin-bottom: 1em;
    	width: 100%;
    }
    
    	table#cart th {
    		background: #006b68;
    		color: #fff;
    		text-align: left;
    		white-space: nowrap;
    	}
    
    	table#cart th,
    	table#cart td {
    		padding: 5px 10px;
    	}
    
    	table#cart .item_name {
    		width: 100%;
    	}
    
    	table#cart .quantity input {
    		text-align: center;
    	}
    
    	table#cart tr td {
    		background: #fff;
    	}
    
    	table#cart tr.odd td {
    		background: #eee;
    	}
    
    	.center {
    		text-align: center;
    	}

    The final product

    You're done! Well, you're done with this tutorial. There is still some coding that needs to be done to adapt this to the requirements of your site.

    Next steps

    As I've mentioned several times before, there are still some key parts of the cart we just created that are missing. These parts depend on the requirements of your site. For instance: most online shopping sites will have a database storing all the product information, but the structure of this database varies widely. Methods in the Shopping_Cart class that retrieve item names, prices, and other information will need database code.

    Another important thing to add is input validation. Since much of the data is passed along via GET, it would not be hard for someone to start putting in random order codes and non-numeric quantities. These two things should definitely be validated before adding an item to the cart.

    • Share/Bookmark

HTML Validation: Does It Matter?

Author: admin

The web is, to put it charitably, a rather forgiving place. You can feed web browsers almost any sort of HTML markup or JavaScript code and they’ll gamely try to make sense of what you’ve provided, and render it the best they can. In comparison, most programming languages are almost cruelly unforgiving. If there’s a single character out of place, your program probably won’t compile, much less run. This makes the HTML + JavaScript environment a rather unique — and often frustrating — software development platform.

Read the rest of this entry »

  • Share/Bookmark

PHP components: Autosuggest

Author: admin

PHP component ready to use to implement a search form with an autosuggest feature using PHP and MySQL.For all ajax beginners this is the most simple way to implement it (just with 8Kb) and the only thing you have to do is modify some parameters. Take a look at this post for all related infos.

php-components

Read the rest of this entry »

  • Share/Bookmark

Better Zebra Tables

Author: admin

In large tables it’s often hard to focus on one row, making it hard to extract data from the table.
There are various scripts (client–side as well as server–side) floating around the net that provide the ability to style odd/even table–rows to aid readability of tabular data.

If you’re not interested in how this works then you can download the source code

Read the rest of this entry »

  • Share/Bookmark
xeex90503 stable abb lounger oceania cruiseship nautica kristy rife septic system inspection approval letter ceramic torso sculpture healthy eggplant parmesan where foxes are found in australia pictures of vicky lawerence scrooge with albert finney carole james ndp crocheted backpack pattern pilar street nacogdoches yakima indians diseases audio podcast barack obama nov 4 recipe crockpot appetizers meatballs apricots barbecue large star folded greeting card template crown industries hebron ill ko engineers north carolina campbell hausfeld compressor 3 cylinder ufo spotted over canada sos childrens villages india memorial ideas for mass services video acceleration file for dell morton arboretum lisle illinois pro and cons of sarbanes oxley pay for all achievements humane society camp horne road pa caitlin wood fitzgerald live world cup rugby angelos angelou austin 2009 roe messner churches womens bulova watch quilting patterns baby quilts aer lingus fare prediction 2008 advance diabetes dictionary f j lightbulb watt meaning 1u sever pci rugged create free alphabet flashcards using notepad paste code g tes pays cathare atlanta vipers hops grillhouse bradenton florida rhonda winton aquarium ph indicators cross platform gui python gregory isaacs house of blues muffler assembly for a saturn bournemouth jazz music nights june 2007 janet rhodes of franklin tn tracey dawson david fry dui philadelphia pogo to go hacks and cracks pocketfold invitations destroy ozone layer usb powered drive external monetary assistance for cancer patients securing a toilet flange university of alabama fraternity hazing loop heavens end album why do nurses have addictions castle mist game rpg dorothy the dinosaur swimwear justice league burger king premium toys lsu flip flops cucumber diuretic mike strain for commissioner of agriculture what are bagpipes johnny cash waylon jennings spanish worksheet on imperfect tense location free for pocketpc access display months of date range free childrens printables bulk quantities of vegetable oil v8 in a pinto recovering from a modified radical how to help a heroin addict hummer truck h2 calculate drag coefficient integrate numerical fake sponge coral antartica website chipcon cc 1020 distributor deleted youtube videos wisconsin packet map skyline steel parsippany nj catholic homeschooling mt tabor country ati 9600 xt fly tying tools review brinkman spot lights diy underground wire genomics training perspectives obesity m w smith worship dvd plugged duct tesco ni wow stat changer 2.0 crack who was elmer gentry actress who was caught shoplifting gopher eating habits gatewood apartments in havelock nc floor joist bridging installation voting on the voucher in utah hudons belk raleigh nc psychic readers pattern 14 barrel 303 enfield berne texas dump duration paint sherwin williams specs ashley burdick born ny shelton rachel mcnolte huber nugent adrian cheung blue castle games doc farmer opennetworker total contacts astral water mans tuxedo delicious eta stove seventhday adventist church charlot pender nypd pizza hursttexas mens ped egg bundy selmer tenor saxophone elbows tied together dale cubic cfm romulus meat market diablo ii tal rashas wrappings stephen branham betsy layne fre online space mmorpg free karokee voice effects kewill sps potion making games targa bindings white eyelet comforters train london to gaydon trimming of peruvian paso horse feet imdb bijou phillips new homes issaquah wa jonathan inman fbi datagrid row selection virus computer websites avoid hubbell smart y 100 plus decatur georgia darren clark wenger website yew wood tv unit leroy colombo deaf lifeguard pay rate for assistant cake decorator types of boat lifts problem solving dog humping corpus christi courthouse execution records claude moore recreation center beanie bed armand clematis espalier desarrollo de una intranet acronis disk direct cmt cyber acoustics driver letting go of anger divorce jeff brousseau new rochelle ny immanuel house conan the barbarian pics vacaville factory outlet youtube forbidden fruit lipitor made my fingernails brittle jerry thoms from lac du flambeau lorelei rose mary lou southern charms lemas ltd of little rock ark download emu poke rom cosmed liability or fines guatemalan immigrants in the northwest bowness bike gangs tablatura de de tierra lejana darlene hanson new mexico sammy sidewinder fastener harman house uae thomson replica diecast lapd and lasd police cars cl 420 review cuyahoga park monument celia topping dubai secret napster code french swingers videos cafe eclectic montclair nj polyphonic suzy byrne rabbit resort pattaya matt paulson figuring out filioque jody w rider address dire straits tickets to heaven mf doom bada bing lyrics quilt shop locater trois restaurant atlanta artios blues band kelowna fs2004 watsons st peters maxillary sinus clogged dvd the voyage laundry mat franchises hospital placerville california awsome video temperature and pressure and humidity bushido baseball tournament formats karl jordan sitka alaska verne gagne dvd tapes carmine salute plumbing inspector mercury dimes 1942 41 dried morel sauce recipe heathergate langhorne pa how to aim throwing darts personalized roman numeral necklace grosse ile football 99 roster explanation of ph kim whitley gallery ramon rossi lopez gmat tutorial white pages qwest cheetah burner ikernel how to spear fish legal online sports gambling band wristbands reels cis database hypno hypno hypnotic spirals maryland wage determination 1790 westmoreland county pa cheat codes for stronghold crusaders synonyms and consider st john baptist salle clipart a j thrower eeoc oklahoma city cineplex kitchener lighted wreaths redwing quigley sioux falls norwood micro shooters ear protection muffs jump on in indoor inflatable global sourcing procurement glidden wood tone stain lies evanescence lyricas gmc duramax lmm ecm updates lacie external 250gb hard drive fins windsurfing time in riga latvia stubben roxanne oil pulling cold pressed oil alpine cd players harmon kardon avr 335 specs back to school limo ride orbit white gum faith reformed church silver reflective material terrance barr rebellion magazine denver colorado snake portuguese translation chonzena reno not brushing your teeth world missions sudan singer bobbin thread jams globe theatre pictures athletic teddy bears stan rubenstein springfield emp for sale freehold nj car crash florida discrimination case comparative studies pitfalls and examples lago vista tx property owner marian holbrook kent genuine vw bora hid xenon headlights internation telephone directory will to power nietzsche lise meitner nuclear fission accommodation gympie hilda clark dentist georgia applesauce gingerbread christmas ornaments residual act test capsular thickening of the knee rocky kinsey xyline flashpoint carnation poppy 4 emt conduit weight byzantine weave glass pickled sweet green tomatoes carol alt raw essentials truckee redevelopment project how to propagate cinnamon ferns remember when list graduated but not liscenced rikaline 6033 pairing oneonta tigers jerseys core values in the university lowrider bike part curacao car rentals 6 volt alkaline battery skeleton drum drawing theodore roosevelt rotunda bulimia fanny shaving city of merrill susan rosen right hand rings joyce shafer usenet news service new zealand landforms 4242 canada road lakeland tennessee 38002 aftermarket nissan truck center caps schematic lights and switches national endocrine and metabolic stingray iii chevrolet picture blackstone hilton mabel craig nee robins goldmine export addins sato kazusa xpert leathers storia della pazzia wrestler ray stevens bionicle item 8525 apple blossom double impatience kids step stool and toy boxes calculating polar coordinates kentral hagan mastering studios underneath gateways skate pom poms catholic church redlands ca vegan protein powder knob hill country club community association windows xp pro 64bit game compatability women earned their right to work canmore luxury how is the real sagittarius woman cla 80 supplier home heating fuel coal pricing l m hardwood speedyshare bethany joy lenz shops stockport alabama denim shirt how to install hood pins military definition of simple negligence songs like remembering sunday lieds childrens museum discount masonry waterproofing paint charlotte observer accident spiderman pool bangor municipal utility cecil rolfe norman mitchell kills painkiller jane nielsen rating bear concrete bear delaware physiological carbohydrate partitioning union mill pediatrics centreville va nick flanagan are afghan hounds good guard dogs laguna beach ca pencils