<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BLUEice studios</title>
	<atom:link href="http://www.blueicestudios.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blueicestudios.com</link>
	<description>Solutions for Mixed Media &#38; Web Development.</description>
	<lastBuildDate>Mon, 16 Nov 2009 08:09:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ajax Refresh</title>
		<link>http://www.blueicestudios.com/ajax-refresh/</link>
		<comments>http://www.blueicestudios.com/ajax-refresh/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 05:26:00 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Featured Articles]]></category>

		<guid isPermaLink="false">http://www.blueicestudios.com/?p=173</guid>
		<description><![CDATA[Div Refreshing with Ajax.


function createRequestObject() {

   var req;

   if(window.XMLHttpRequest){
      // Firefox, Safari, Opera...
      req = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
      // Internet Explorer 5+
      req = new ActiveXObject("Microsoft.XMLHTTP");
 [...]]]></description>
			<content:encoded><![CDATA[<p>Div Refreshing with Ajax.</p>
<pre class="brush:js">

function createRequestObject() {

   var req;

   if(window.XMLHttpRequest){
      // Firefox, Safari, Opera...
      req = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
      // Internet Explorer 5+
      req = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
      // There is an error creating the object,
      // just as an old browser is being used.
     alert("Your Browser Does Not Support This Script - Please Upgrade Your Browser ASAP");
   }

   return req;

}

// Make the XMLHttpRequest object
var http = createRequestObject();

function sendRequest(page) {

   // Open PHP script for requests
   http.open('get', page);
   http.onreadystatechange = handleResponse;
   http.send(null);

}

function handleResponse() {

   if(http.readyState == 4 &#038;&#038; http.status == 200){

      // Text returned FROM the PHP script
      var response = http.responseText;

      if(response) {
         // UPDATE ajaxTest content
         document.getElementById("div id").innerHTML = response;
      }

   }

}

function repeatloop()
{
sendRequest('page.php');
setTimeout("repeatloop()", 2000);
}

window.onload=function() {
repeatloop();
}
</pre>
<p>div id is the div in which the page is loaded.<br />
edit &#8220;page.php&#8221; as the page to load.<br />
change the timeout to your liking. 2000 is 2 seconds.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blueicestudios.com/ajax-refresh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery: Filter Select box with php and mysql</title>
		<link>http://www.blueicestudios.com/jquery-filter-select-box-with-php-and-mysql/</link>
		<comments>http://www.blueicestudios.com/jquery-filter-select-box-with-php-and-mysql/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 00:58:33 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[select box]]></category>

		<guid isPermaLink="false">http://www.blueicestudios.com/?p=140</guid>
		<description><![CDATA[Lets filter a select box with jQuery, Sack, PHP and MySQL&#8230;..
You may or may not need this, but it could come in handy at one point in time. So lets start..
I will show you the basics here, you may download the source at the bottom of the page.
View the DEMO
index.html
include these into the head section [...]]]></description>
			<content:encoded><![CDATA[<p>Lets filter a select box with jQuery, Sack, PHP and MySQL&#8230;..</p>
<p>You may or may not need this, but it could come in handy at one point in time. So lets start..</p>
<p>I will show you the basics here, you may download the source at the bottom of the page.</p>
<p>View the <a href="http://www.blueicestudios.com/filter_select/" target="_blank">DEMO</a></p>
<p>index.html</p>
<p>include these into the head section of the page. ajax.js is the Sack js functions. I will get into Sack later.</p>
<pre class="brush:html">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script> <script src="sack.js" type="text/javascript"></script>
</pre>
<p>this goes into the head as well.</p>
<pre class="brush:js">
var ajax = new Array();

function getTextList(sel)

{

var color = document.getElementById('color').value; //gets value from text input

document.getElementById('colorReturn').options.length = 0;

if(color.length&gt;0){

var index = ajax.length;

ajax[index] = new sack();

ajax[index].requestFile = 'getColor.php?color='+color; //sends the GET to the php page

ajax[index].onCompletion = function(){ createText(index) };

ajax[index].runAJAX();

}

}

function createText(index)

{

var obj = document.getElementById('colorReturn'); //retruns the options from the php page

eval(ajax[index].response);

}
</pre>
<p>The form</p>
<pre class="brush:html">
<form method="post">
<select id="colorReturn" style="width: 200px;" name="colorReturn" size="5">
</select>
<h4>Filter the colors - Start typing black.</h4>
<input id="color" onkeyup="getTextList();" name="color" type="text" />
</form>
</pre>
<p>Thats it for the index page. pretty straight forward. So now for the fun part.</p>
<p>getColor.php &#8211; This page contains the sql and php that returns the</p>
<pre class="brush:php">
mysql_connect("localhost", "username", "password") or die(mysql_error());

mysql_select_db("database") or die(mysql_error());

$color = $_GET['color'];

if(isset($_GET['color'])){

$result = mysql_query("SELECT color FROM colors WHERE color LIKE '%$color%' LIMIT 0,10")

or die(mysql_error());

while($color = mysql_fetch_array( $result ))

{

echo 'obj.options[obj.options.length] = new Option("'.$color['color'].'","'.$color['color'].'");';

}

}
</pre>
<p>Its not the most detailed tutorial, but im not a tutorial guy.</p>
<p>View the <a href="http://www.blueicestudios.com/filter_select/" target="_blank">DEMO</a></p>
<p>Download the <a href="http://www.blueicestudios.com/filter_select/getColor.zip">SOURCE</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blueicestudios.com/jquery-filter-select-box-with-php-and-mysql/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Chained Select Boxes using PHP / MySQL / AJAX</title>
		<link>http://www.blueicestudios.com/chained-select-boxes-using-php-mysql-ajax/</link>
		<comments>http://www.blueicestudios.com/chained-select-boxes-using-php-mysql-ajax/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 11:42:12 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[chained select boxes]]></category>

		<guid isPermaLink="false">http://www.blueicestudios.com/?p=123</guid>
		<description><![CDATA[So, I got sick of using multiple singular select boxes. For this latest project I ended up with a table containing a category and text. About 500 entries. I used the AJAX from http://dhtmlgoodies.com
Source Files: DOWNLOAD
Check out the DEMO
The MySQL is simple, just an id, category and text field. There are multiple of the same [...]]]></description>
			<content:encoded><![CDATA[<p>So, I got sick of using multiple singular select boxes. For this latest project I ended up with a table containing a category and text. About 500 entries. I used the AJAX from <a href="http://dhtmlgoodies.com">http://dhtmlgoodies.com</a></p>
<p>Source Files: <a href="http://www.blueicestudios.com/selects/chained_select.zip">DOWNLOAD</a><br />
Check out the <a href="http://www.blueicestudios.com/selects/">DEMO</a></p>
<p>The MySQL is simple, just an id, category and text field. There are multiple of the same category so I will start with the mysql connection and the query to pull them into a select using distinct.</p>
<p><strong><em>dbcommon.php</em></strong></p>
<pre class="brush:php">
 	mysql_connect("localhost", "username", "password") or die(mysql_error());
	mysql_select_db("databasename") or die(mysql_error());
</pre>
<p>Select Boxes.</p>
<pre class="brush:html">
<form action="" method="post">
<select id="category" name="category" onchange="getTextList(this)">

	    <option value="">Select a Category</option>
	    <!-- PHP Snippet from below goes here -->
	</select>
<select id="text" name="text" style="visibility:hidden;"></select>
<input type="submit" value="Submit" />
</form>
</pre>
<p>main select box query</p>
<pre class="brush:php">
$result = mysql_query("SELECT DISTINCT category FROM dialogue")
			or die(mysql_error());

			while($cat = mysql_fetch_array( $result )) 

			{        //this syntax highlighter blows, there should be option tags in this echo.
				  echo '<option value="'.$cat['category'].'">'.$cat['category'].'</option>';
			}
</pre>
<p>JS within the select box page.</p>
<pre class="brush:js">
<script type="text/javascript" src="ajax.js"></script>
<script type="text/javascript">

var ajax = new Array();

function getTextList(sel)
{
	var category = sel.options[sel.selectedIndex].value;
	document.getElementById('text').options.length = 0;
	if(category.length>0){
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getText.php?category='+category;
		ajax[index].onCompletion = function(){ createText(index) };
		ajax[index].runAJAX();
                document.getElementById('text').style.visibility = 'visible'; 
	}
}

function createText(index)
{
	var obj = document.getElementById('text');
	eval(ajax[index].response);	
}	
</script>
</pre>
<p>getText.php</p>
<pre class="brush:php">
include('dbcommon.php');

    $category = $_GET['category'];

	if(isset($_GET['category'])){

		$result = mysql_query("SELECT * FROM dialogue WHERE category='$category'")
	    or die(mysql_error());

			 while($text = mysql_fetch_array( $result )) 

			  {
				echo 'obj.options[obj.options.length] = new Option("'.$text['text'].'","'.$text['id'].'");';
			  } 

	}
</pre>
<p>Im not much for tutorials but you can see the way I did it. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.blueicestudios.com/chained-select-boxes-using-php-mysql-ajax/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Grab MySpace UserInfo</title>
		<link>http://www.blueicestudios.com/grab-myspace-userinfo/</link>
		<comments>http://www.blueicestudios.com/grab-myspace-userinfo/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 10:46:25 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[myspace]]></category>

		<guid isPermaLink="false">http://www.blueicestudios.com/?p=94</guid>
		<description><![CDATA[In this tutorials I will show you how to grab from MySpace: User default photo, Profile name, age, sex, location and link.
So lets start with the php to pull the info from MySpace. In this example i will be using a form to pull the user.
Get the source files: DOWNLOAD
See the DEMO
name this file &#8220;myspace.class.php&#8221;

//the [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorials I will show you how to grab from MySpace: User default photo, Profile name, age, sex, location and link.</p>
<p>So lets start with the php to pull the info from MySpace. In this example i will be using a form to pull the user.<br />
Get the source files: <a href="http://www.blueicestudios.com/myspace/myspace.zip">DOWNLOAD</a><br />
See the <a href="http://www.blueicestudios.com/myspace/" target="_blank">DEMO</a></p>
<p>name this file &#8220;myspace.class.php&#8221;</p>
<pre class="brush:php">
//the function
function myspace(){

//keeps the page clear until the form is submitted.
if($_POST['submit']){ 

  //Gets name or email from the form
  $name = $_POST['name'];
  //Gets the source code from the MySpace page
  $source = implode(file("http://searchservice.myspace.com/index.cfm?fuseaction=sitesearch.results&#038;type=People&#038;qry=".$name.""));
  //Look for
<div class="searchResults">
  $search = '
<div class="searchResults">';
  //here is where we seperate everything from the page except the $search value
  $newText = substr($source,strpos($source, $search)+strlen($search), 1000);
  //if the user doesnt exist
  $destroy = strip_tags($newText, '<img>
<div></div>

<a></a><span></span><br/>
<ul></ul>
<li></li>

<b></b>');
  //If the user doesnt exist it will print the doctype code, the code contains dtd
  if(strstr($destroy, 'dtd')){

    echo "
<div class=\"exist\">";
    //if dtd is present lets make it say...
    echo "".$_POST['name'].", Does not exist on MySpace";

    echo "</div>

";

  }else{

    echo "
<div class=\"searchResults\">";
    //otherwise show the search results
    echo strip_tags($newText, '<img>
<div></div>

<a></a><span></span><br/>
<ul></ul>
<li></li>

<b></b>');

    echo "</div>

";
  }

 }

}
</pre>
<p>next the form/results page</p>
<pre class="brush:html">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="style.css" type="text/css">
</head>

<body>
<div style="padding:10px;">
<form action="<?php PHP_SELF; ?>" method="post">
Enter MySpace username or email:
<input name="name" type="text" >
<input name="submit" type="submit" value="Find User">
</form>
</div>

</body>
</html>
</pre>
<p>Add this under the form</p>
<pre class="brush:php">
   include ('myspace.class.php');
   myspace();
</pre>
<p>Now for style.css</p>
<pre class="brush:css">
body {
font-family:verdana,arial,helvetica,sans-serif;
font-size:11px;
}
.searchResults {
float:left;
width:auto;
}
.profilePhoto {
float:left;
overflow:hidden;
padding:13px 25px 13px 7px;
}
.userInfo {
float:left;
line-height:18px;
padding:10px 0;
}
.userInfo a {
font-size:12px;
text-decoration:underline;
}
.vanity {
color:#008800;
}
.profilePhoto img {
width:80px;
}
.pilRealName {
display:none;
}
.doIt {
display:none;
}
.exist {
padding:10px;
font-weight:bold;
}
img {
border:0 none;
}
</pre>
<p>Now run it, enter a username or email and grab some MySpace User Info. I use this on another site, using thier emails from the database to pull thier user info. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.blueicestudios.com/grab-myspace-userinfo/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>5 Minute Flex Data Grid</title>
		<link>http://www.blueicestudios.com/5-minute-flex-data-grid/</link>
		<comments>http://www.blueicestudios.com/5-minute-flex-data-grid/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 09:21:15 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Datagrid]]></category>

		<guid isPermaLink="false">http://www.blueicestudios.com/?p=22</guid>
		<description><![CDATA[So you want a quick solution for a data grid with inline edit, add, delete, search and sorting? I&#8217;ve got just the answer for you. &#8230;..Adobe Flex.
Finished Data Grid: Demo
So lets start, The data used for the grid will be pulled from a MySQL database.
If you don&#8217;t have one ready, use this to get an [...]]]></description>
			<content:encoded><![CDATA[<p>So you want a quick solution for a data grid with inline edit, add, delete, search and sorting? I&#8217;ve got just the answer for you. &#8230;..Adobe Flex.</p>
<p>Finished Data Grid: <a title="Demo" href="http://www.blueicestudios.com/datagrid/" target="_blank">Demo</a></p>
<p>So lets start, The data used for the grid will be pulled from a MySQL database.</p>
<p>If you don&#8217;t have one ready, use this to get an idea.</p>
<pre>
CREATE DATABASE `flex_grid` ;

CREATE TABLE `flex_grid`.`grid_data` (
`user_id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`user_name` VARCHAR( 22 ) NOT NULL ,
`user_email` VARCHAR( 60 ) NOT NULL ,
`user_phone` VARCHAR( 20 ) NOT NULL ,
`user_mobile` VARCHAR( 20 ) NOT NULL ,
PRIMARY KEY ( `user_id` )
) ENGINE = InnoDB;

INSERT INTO `flex_grid`.`grid_data` (
`user_id` ,
`user_name` ,
`user_email` ,
`user_phone` ,
`user_mobile`
)
VALUES (
NULL , 'Joe Blow', 'joe@blow.com', '123-456-7890', '321-654-0987'
);</pre>
<p>Ok, once you get this running or if you have your own lets start.</p>
<h3>Step 1: Creating the Flex Project</h3>
<p>Open up Adobe Flex if you don&#8217;t already have it open&#8230;&#8230; Got it open? Ok good.</p>
<p>Now navigate to File &gt; New &gt; Flex Project</p>
<p><a href="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig1.jpg" target="_blank"><img class="alignnone size-thumbnail wp-image-23" title="fig1" src="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig1-150x150.jpg" alt="fig1" width="150" height="150" /></a></p>
<p>Next lets set up the project.</p>
<p>Create a project name and choose PHP from the dropdown list.</p>
<p><a href="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig2.jpg" target="_blank"><img class="alignnone size-thumbnail wp-image-24" title="fig2" src="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig2-150x150.jpg" alt="fig2" width="150" height="150" /></a></p>
<p>Hit Next,</p>
<p>Now create a folder where you want the project to be added as well as a URL to the project and click Validate Configuration.</p>
<p><a href="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig3.jpg" target="_blank"><img class="alignnone size-thumbnail wp-image-25" title="fig3" src="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig3-150x150.jpg" alt="fig3" width="150" height="150" /></a></p>
<p>Hit Next, the project will be created. Then simple hit Finish.</p>
<h3>Step2: Create Application From Database.</h3>
<p>You should now have a project with a blank blue canvas.</p>
<p>Navigate to Data &gt; Create Application from Database&#8230;</p>
<p><a href="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig4.jpg"><img class="alignnone size-thumbnail wp-image-28" title="fig4" src="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig4-150x126.jpg" alt="fig4" width="150" height="126" /></a></p>
<p>Click &#8220;New&#8221; to setup a new connection..</p>
<p><a href="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig5.jpg"><img class="alignnone size-thumbnail wp-image-29" title="fig5" src="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig5-150x150.jpg" alt="fig5" width="150" height="150" /></a></p>
<p>Give the connection a name and hit next&#8230;</p>
<p><a href="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig6.jpg"><img class="alignnone size-thumbnail wp-image-30" title="fig6" src="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig6-150x150.jpg" alt="fig6" width="150" height="150" /></a></p>
<p>The MySQL Connection info and hit next..</p>
<p><a href="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig7.jpg"><img class="alignnone size-thumbnail wp-image-31" title="fig7" src="http://www.blueicestudios.com/wp-content/uploads/2009/07/fig7-150x150.jpg" alt="fig7" width="150" height="150" /></a></p>
<p>Now just hit Finish.</p>
<p>From here it will create the grid.</p>
<p>Now, navigate to File &gt; Export &gt; Release Build.</p>
<p>Pretty straight forward from here on.</p>
<p>Finished Data Grid: <a title="Demo" href="http://www.blueicestudios.com/datagrid/" target="_blank">Demo</a></p>
<p>I hope this helped you with learning a nice feature of Adobe Flex.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blueicestudios.com/5-minute-flex-data-grid/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP Percentage Bar</title>
		<link>http://www.blueicestudios.com/php-percentage-bar/</link>
		<comments>http://www.blueicestudios.com/php-percentage-bar/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 23:32:28 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php percentage bar]]></category>

		<guid isPermaLink="false">http://www.blueicestudios.com/?p=14</guid>
		<description><![CDATA[
Source Files: DOWNLOAD
View working examples here: DEMO
MySQL Table, used for example.

CREATE TABLE IF NOT EXISTS `percent` (
`per_id` int(11) NOT NULL auto_increment,
`per_num` varchar(255) NOT NULL,
PRIMARY KEY (`per_id`)
) ENGINE=InnoDB;

1. Lets start with the MySQL Connection, I named this file dbcommon.php. Besure to change the username, password and database to your own.

mysql_connect("localhost", "username", "password") or die(mysql_error());
mysql_select_db("databasename") or die(mysql_error());

2. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-18 alignnone" title="percentss" src="http://www.blueicestudios.com/wp-content/uploads/2009/06/percentss.gif" alt="percentss" width="263" height="152" /></p>
<div style="font-size:12px; color:#333333;">Source Files: <a href="http://www.blueicestudios.com/percent/percent.zip">DOWNLOAD</a></div>
<div style="font-size:12px; color:#333333;">View working examples here: <a href="http://www.blueicestudios.com/percent/" target="_blank">DEMO</a></div>
<p>MySQL Table, used for example.</p>
<pre class="brush:sql">
CREATE TABLE IF NOT EXISTS `percent` (
`per_id` int(11) NOT NULL auto_increment,
`per_num` varchar(255) NOT NULL,
PRIMARY KEY (`per_id`)
) ENGINE=InnoDB;
</pre>
<p>1. Lets start with the MySQL Connection, I named this file <strong>dbcommon.php</strong>. Besure to change the username, password and database to your own.</p>
<pre class="brush:php">
mysql_connect("localhost", "username", "password") or die(mysql_error());
mysql_select_db("databasename") or die(mysql_error());
</pre>
<p>2. <strong>function.php</strong> will contains the script for the query and bar. I setup the 4 function examples as in the demo.</p>
<pre class="brush:php">
function percent_full(){

  $result = mysql_query("SELECT * FROM percent")
  or die(mysql_error());

	 while($full = mysql_fetch_array( $result )) {
		echo '
<div id="bar_wrap_full">
<div style="height:'.(100-$full['per_num']).'px;"></div>
<div class="top"></div>
<div id="bar" class="center" style="height:'.($full['per_num']).'px;"></div>
<div class="bottom"></div>
<div class="num">'.($full['per_num']).'%</div>
<div style="text-align:center;">id:'.($full['per_id']).'</div>
</div>

		';
	 } 

}

function percent_button(){

  $result = mysql_query("SELECT * FROM percent")
  or die(mysql_error());

	 while($button = mysql_fetch_array( $result )) {
		echo '
<div id="bar_wrap_button">
<div style="height:'.(100-$button['per_num']).'px;"></div>
<div class="top"></div>
<div id="bar" class="center"></div>
<div class="bottom"></div>
</div>

		';
	 }

}

function percent_donation_full(){

  $result = mysql_query("SELECT * FROM percent WHERE per_id=18")
  or die(mysql_error());

	 while($donation_full = mysql_fetch_array( $result )) {
		echo '
<div id="bar_wrap_donation_full">
<div style="height:'.(100-$donation_full['per_num']).'px;"></div>
<div class="top">
<div class="num"> $'.($donation_full['per_num']).'</div>
</div>
<div id="bar" class="center" style="height:'.($donation_full['per_num']).'px;"></div>
<div class="bottom"></div>
</div>

		';
	 } 

}

function percent_donation_button(){

  $result = mysql_query("SELECT * FROM percent WHERE per_id=18")
  or die(mysql_error());

	 while($donation_button = mysql_fetch_array( $result )) {
		echo '
<div id="bar_wrap_donation_button">
<div style="height:'.(100-$donation_button['per_num']).'px;"></div>
<div class="top">
<div class="num"> $'.($donation_button['per_num']).'</div>
</div>
<div id="bar" class="center"></div>
<div class="bottom"></div>
</div>

		';
	 } 

}
</pre>
<p>3. <strong>style.css</strong> page will control the way the bars are shown.</p>
<pre class="brush:css">
@charset "utf-8";
#no-margin {
margin:0px;
}
/* Begin Percentage Bar Full */
#bar_wrap_full {
width:24px;
height:106px;
background:url(img/measure.gif) no-repeat right;
font-size:9px;
font:Arial, Helvetica, sans-serif;
color:#999;
float:left;
margin-right:20px;
}

#bar_wrap_full div.top {
width:20px;
height:3px;
background:url(img/bar_top.gif) no-repeat;
}

#bar_wrap_full div.center {
width:20px;
background:url(img/bar_cent.gif) repeat-y;
}

#bar_wrap_full div.bottom {
width:20px;
height:3px;
background:url(img/bar_bot.gif) no-repeat;
}

#bar_wrap_full div.num {
text-align:center;
}

#bar_wrap_full div.overlay {
background:url(img/lines.png) no-repeat;
width:24px;
height:106px;
}
/* End Percentage Bar Full */

/* Begin Percentage Bar Button */
#bar_wrap_button {
width:24px;
height:106px;
background: url(img/measure_buttons.gif) no-repeat right;
font-size:9px;
font:Arial, Helvetica, sans-serif;
color:#999;
float:left;
margin-right:20px;
}

#bar_wrap_button div.top {
width:20px;
height:3px;
background:url(img/bar_top.gif) no-repeat;
}

#bar_wrap_button div.center {
width:20px;
background:url(img/bar_cent.gif) repeat-y;
}

#bar_wrap_button div.bottom {
width:20px;
height:3px;
background:url(img/bar_bot.gif) no-repeat;
}

#bar_wrap_button div.num {
text-align:center;
}

#bar_wrap_button div.overlay {
background: url(img/stripes.png) bottom;
width:24px;
height:auto;
}

/* End Percentage Bar Button */

/* Begin Percentage Bar Full */
#bar_wrap_donation_full {
width:24px;
height:106px;
background:url(img/measure.gif) no-repeat right;
font-size:9px;
font:Arial, Helvetica, sans-serif;
color:#999;
float:left;
margin-right:20px;
}

#bar_wrap_donation_full div.top {
width:50px;
height:3px;
background:url(img/bar_top.gif) no-repeat left;
}

#bar_wrap_donation_full div.center {
width:20px;
background:url(img/bar_cent.gif) repeat-y;
}

#bar_wrap_donation_full div.bottom {
width:20px;
height:3px;
background:url(img/bar_bot.gif) no-repeat;
}

#bar_wrap_donation_full div.num {
text-align:center;
margin-left:20px;
line-height:0;
}

#bar_wrap_donation_full div.overlay {
background:url(img/lines.png) no-repeat;
width:24px;
height:106px;
}
/* End Percentage Bar Full */

/* Begin Percentage Bar button */
#bar_wrap_donation_button {
width:24px;
height:106px;
background:url(img/measure_buttons.gif) no-repeat right;
font-size:9px;
font:Arial, Helvetica, sans-serif;
color:#999;
float:left;
margin-right:20px;
}

#bar_wrap_donation_button div.top {
width:50px;
height:3px;
background:url(img/bar_top.gif) no-repeat left;
}

#bar_wrap_donation_button div.center {
width:20px;
background:url(img/bar_cent.gif) repeat-y;
}

#bar_wrap_donation_button div.bottom {
width:20px;
height:3px;
background:url(img/bar_bot.gif) no-repeat;
}

#bar_wrap_donation_button div.num {
text-align:center;
margin-left:20px;
line-height:0;
}

#bar_wrap_donation_button div.overlay {
background:url(img/lines.png) no-repeat;
width:24px;
height:106px;
}
/* End Percentage Bar Full */
</pre>
<p>4. <strong>index.php</strong><br />
Lets add the database connection and functions.</p>
<pre class="brush:php">
include('dbcommon.php');
include('function.php');
</pre>
<p>in the body we will call the functions.</p>
<pre class="brush:php">
percent_full();

percent_button();

percent_donation_full();

percent_donation_button();
</pre>
<hr />
<div style="font-size:12px; color:#333333;">Download, contains images, css, php: <a href="http://www.blueicestudios.com/percent/percent.zip">percentage_bar.zip</a></div>
<div style="font-size:12px; color:#333333;">View a working examples here: <a href="http://www.blueicestudios.com/percent/" target="_blank">demo</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.blueicestudios.com/php-percentage-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Law</title>
		<link>http://www.blueicestudios.com/the-law/</link>
		<comments>http://www.blueicestudios.com/the-law/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 14:29:57 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[law]]></category>
		<category><![CDATA[legal advise]]></category>

		<guid isPermaLink="false">http://www.blueicestudios.com/?p=3</guid>
		<description><![CDATA[ 
Visit: www.TheLaw.com
What is TheLaw.com?
TheLAW.com™ is a free friendly, online environment where lawyers and non-lawyers can find and share all types of legal information, including participating in a free legal discussion forum to find others who have shared a similar legal  problem or experience, locate legal resources such as free legal help guides and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.thelaw.com"><img class="alignnone size-thumbnail wp-image-4" title="thelaw" src="http://www.blueicestudios.com/wp-content/uploads/2009/03/thelaw-150x150.jpg" alt="thelaw" width="150" height="150" /> </a></p>
<p>Visit:<a href="http://www.TheLaw.com" target="_blank"> www.TheLaw.com</a></p>
<h2>What is TheLaw.com?</h2>
<p><a title="TheLaw.com" href="http://www.thelaw.com/archive/faqs/about-thelaw.com/what-is-thelaw.com.html">TheLAW.com</a>™ is a free friendly, online environment where lawyers and non-lawyers can find and share all types of legal information, including participating in a <a title="TheLaw Forums" href="http://www.thelaw.com/archive/faqs/about-thelaw.com/forums/">free legal discussion forum</a> to find others who have shared a similar legal  problem or experience, locate legal resources such as <a href="http://www.thelaw.com/guide/">free legal help guides</a> and searching <a href="http://www.thelaw.com/ny-law/">New York State laws</a>, <a href="http://www.thelaw.com/lawyers/">find a lawyer</a> to retain or <a href="http://www.thelaw.com/casereview/">obtain a free case review</a>, <a href="http://www.thelaw.com/jobs/">find legal jobs</a>, and much more.</p>
<p><a title="TheLaw.com" href="http://www.thelaw.com/archive/faqs/about-thelaw.com/history-of-thelaw.com.html">TheLAW.com</a>™ was founded in 1994 by Michael M. Wechsler when he was a law school student, hoping to help the general public deal with the significant challenges that our legal system presents to non-lawyers. All too often, people encounter legal problems that are either too small to involve an attorney or do not have the means to afford retaining a lawyer. TheLaw.com is the web site that helps those that need free legal assistance obtain the help they need and connects clients who need professional help in retaining an appropriate attorney.</p>
<p>In February of 2000, <a title="TheLAW.com" href="http://www.thelaw.com/archive/faqs/about-thelaw.com/history-of-thelaw.com.html">TheLAW.com</a> was acquired by a seperate financial investment group featuring the Honorable Mayor Ed Koch, former judge of The People’s Court. The company appeared on the front page of the business section of the New York Times. Later in 2002, TheLaw.com was returned to Mr. Wechsler, who provided it with a new direction that mirrored the founder’s goals. Since then, the site has grown to tens of thousands of members and features a voluminous amount of legal content that is updated regularly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blueicestudios.com/the-law/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
