<?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/"
	>

<channel>
	<title>EJ Web Development</title>
	<atom:link href="http://www.ejwebdevelopment.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ejwebdevelopment.com</link>
	<description>All things web development</description>
	<pubDate>Wed, 28 Jan 2009 08:40:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Writing Solid PHP Code 3 - Avoid the Spaghetti</title>
		<link>http://www.ejwebdevelopment.com/writing-solid-php-code-3-avoid-the-spaghetti/</link>
		<comments>http://www.ejwebdevelopment.com/writing-solid-php-code-3-avoid-the-spaghetti/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 07:12:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.ejwebdevelopment.com/?p=385</guid>
		<description><![CDATA[Unfortunately, a lot of PHP code written today is procedural spagetti code. For smaller applications it may be okay, but larger applications we need to make use of classes.
Classes allow you to make new object variables that can perform all the functionality of the class. Take a look at an example of a class:

class car
&#123;
 [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Unfortunately, a lot of PHP code written today is procedural spagetti code. For smaller applications it may be okay, but larger applications we need to make use of classes.</p>
<p>Classes allow you to make new object variables that can perform all the functionality of the class. Take a look at an example of a class:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> car
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Define the function start() with no parameters    </span>
    <span style="color: #000000; font-weight: bold;">function</span> start<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$started</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$started</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>We will create a new car object with the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$myCar</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> car<span style="color: #339933;">;</span>
<span style="color: #000088;">$isStarted</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$myCar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Using classes, we can focus on the specific roles of each piece of code and test it accordingly. If we have classes we know have been tested to work, we can use inheritance to extend the functionality of these classes. We are building a solid base and building up from there. </p>
<p>All of your scripts core functionality should use classes. Classes make code more reusable, easier to test, and easier to read and maintain.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ejwebdevelopment.com/writing-solid-php-code-3-avoid-the-spaghetti/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Writing Solid PHP Code 2 - Naming and Style</title>
		<link>http://www.ejwebdevelopment.com/writing-solid-php-code-2-naming-and-style/</link>
		<comments>http://www.ejwebdevelopment.com/writing-solid-php-code-2-naming-and-style/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 09:42:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[maintainable]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[professional]]></category>

		<category><![CDATA[solid]]></category>

		<guid isPermaLink="false">http://www.ejwebdevelopment.com/?p=371</guid>
		<description><![CDATA[Having a consistent style makes your PHP code more readable and maintainable. Even in projects where you are the only programmer, once the project progresses to a certain size it can become difficult to maintain.
Variable Names
Variable names should be very descriptive. They should give anyone that is not familiar with your script to understand what [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Having a consistent style makes your PHP code more readable and maintainable. Even in projects where you are the only programmer, once the project progresses to a certain size it can become difficult to maintain.</p>
<p><strong>Variable Names</strong></p>
<p>Variable names should be very descriptive. They should give anyone that is not familiar with your script to understand what its for without much digging.</p>
<p>Variable names should all follow the same conventions. It doesn't matter if you use camel casing (YourVariableName), lower camel case (yourFunctionName), or underscores (your_variable_name), as long as all the variable names have the same style.</p>
<p>It is a good idea to include the scope of the variable in the name. For example, if you have a function or set of functions dedicated to parsing a string you may want to start the variable name with "parse."</p>
<p><strong>Function Names</strong></p>
<p>Function names should also be very descriptive and follow a defined convention. Function names should be prefixed with the unit they are in. For example, if you have a file named databaseFunctions.php you might prefix all the functions within that file with dbFuncs_ or something similar.</p>
<p>Function names should describe the action taking place. For example, instead of "StringParser()" use "ParseString()."</p>
<p><strong>Indentation</strong></p>
<p>Indentation is very important as it makes reading the code easier. Proper indentation can help you keep track of loops, conditional statements, and blocks of code. Each level should be indented a step further. The following snippet is a good example of proper indentation:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #000088;">$loopVariable</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">35</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$loopCounter</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$loopCounter</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">25</span><span style="color: #339933;">;</span> <span style="color: #000088;">$loopCounter</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$loopVariable</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$loopVariable</span><span style="color: #339933;">*</span><span style="color: #000088;">$loopCounter</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$loopVariable</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Even&lt;br &gt;n&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Using good techniques such as proper naming and indentation may seem unneccesary for small projects. However, for larger projects it is essential for writing maintainable code.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ejwebdevelopment.com/writing-solid-php-code-2-naming-and-style/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Writing Solid PHP Code 1 - Error Handling</title>
		<link>http://www.ejwebdevelopment.com/writing-solid-php-code-1-error-handling/</link>
		<comments>http://www.ejwebdevelopment.com/writing-solid-php-code-1-error-handling/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 00:05:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[error]]></category>

		<category><![CDATA[handling]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[solid]]></category>

		<guid isPermaLink="false">http://www.ejwebdevelopment.com/?p=366</guid>
		<description><![CDATA[This is the first in a multiple part series on writing solid PHP code. By solid I mean fast, efficient, maintainable and secure code.
This first article deals with error handling. Error handling can stop problems in your application early in their tracks and take appropriate action. Error handling has the added benefit of adding professionalism [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><em>This is the first in a multiple part series on writing solid PHP code. By solid I mean fast, efficient, maintainable and secure code.</em></p>
<p>This first article deals with error handling. Error handling can stop problems in your application early in their tracks and take appropriate action. Error handling has the added benefit of adding professionalism and also making debugging easier.</p>
<p>Error handling should be applied to any action that has the possibility of failing. Failures in your application are often the result of some unexpected user input, user input should hence always be checked for vailidity.</p>
<p>The most simplistic way of employing error handling is using die(). die() takes a single string argument that it will output and then terminate the script.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;root&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Connected to MySQL the MySQL server! &lt;br \&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;dbtable&quot;</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Connected to Database&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The above example tries to connect to a database, and produces the MySQL error if it failed. It then tries to select a table within the database and also produces the MySQL error if it fails. These are both actions that could fail for many reasons: the connection to the the login information could be incorrect, the connection to the database could be lost, or the table might not exist. Even in this short example there are many reasons why it could potentially fail.</p>
<p>Since this example does only two things, it is okay to terminate the script upon failure. If we have a larger script, however, we may want to note the error and continue running. This is where die() falls short, not only can we not continue executing but the message is outputted to the page. If our script produces an error we want to log it for the administrator to view later as well as keep it hidden from our users.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;root&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">trigger_error</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">E_USER_ERROR</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Connected to MySQL the MySQL server! &lt;br \&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;dbtable&quot;</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">trigger_error</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">E_USER_ERROR</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Connected to Database&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This example uses the trigger_error() function to throw the error. An error will terminate the script while warnings and notices will allow the script to continue running. Below is a list of types of errors you can throw with trigger_error(). Also note an error can have multiple error types.</p>
<ul>
<li><strong>E_WARNING</strong></li>
<li><strong>E_NOTICE</strong></li>
<li><strong>E_USER_ERROR</strong></li>
<li><strong>E_USER_WARNING</strong></li>
<li><strong>E_USER_NOTICE</strong></li>
</ul>
<p>For a full list, visit the <a href="http://www.php.net/manual/en/errorfunc.constants.php">PHP documentation</a>. Note that not all of the error types in the PHP documentation can be used with trigger_error().</p>
<p>For some errors, notices, and warnings will be outputted to the page. This is good for debugging but bad for live sites. To change this open your php.ini file in your php directory and search for the following line</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">display_errors <span style="color: #339933;">=</span> On</pre></div></div>

<p>Change 'On' to 'Off' and save the configuration file and restart your web server. Make sure log_errors is set to 'On' so that all the errors are saved to a log file for you to review later.</p>
<p>Look for more articles on writing solid PHP code.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ejwebdevelopment.com/writing-solid-php-code-1-error-handling/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Knowledge Base</title>
		<link>http://www.ejwebdevelopment.com/new-knowledge-base/</link>
		<comments>http://www.ejwebdevelopment.com/new-knowledge-base/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 04:07:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[answers]]></category>

		<category><![CDATA[faq]]></category>

		<category><![CDATA[knowledge base]]></category>

		<category><![CDATA[library]]></category>

		<category><![CDATA[questions]]></category>

		<guid isPermaLink="false">http://www.ejwebdevelopment.com/?p=343</guid>
		<description><![CDATA[I have just added a new knowledge base. You can see the link to it on the top menu or here. I will be continuously adding answers over time.
I have also added functionality to ask your own questions, just click on a topic and ask the question at the bottom of the page.
My goal is [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I have just added a new knowledge base. You can see the link to it on the top menu or <a href="http://www.ejwebdevelopment.com/web-knowledge-base/">here</a>. I will be continuously adding answers over time.</p>
<p>I have also added functionality to ask your own questions, just click on a topic and ask the question at the bottom of the page.</p>
<p>My goal is to slowly build a large collection of information that can be easily searched through for quick reference.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ejwebdevelopment.com/new-knowledge-base/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Create an AJAX Based Voting System</title>
		<link>http://www.ejwebdevelopment.com/how-to-create-an-ajax-based-voting-system/</link>
		<comments>http://www.ejwebdevelopment.com/how-to-create-an-ajax-based-voting-system/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 09:59:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[rating]]></category>

		<category><![CDATA[voting]]></category>

		<guid isPermaLink="false">http://www.ejwebdevelopment.com/how-to-create-an-ajax-based-voting-system/</guid>
		<description><![CDATA[This tutorial describes how to create a voting system with stars like below. We assume you have a web server that can run php scripts, a MySQL database, and a browser with javascript enabled.
 
function HoverStars(item, star)
{
var starCount;
for (starCount=1; starCount


No related posts.]]></description>
			<content:encoded><![CDATA[<p>This tutorial describes how to create a voting system with stars like below. We assume you have a web server that can run php scripts, a MySQL database, and a browser with javascript enabled.</p>
<p> <script type="text/javascript">
function HoverStars(item, star)
{
var starCount;
for (starCount=1; starCount<=star; starCount++) 
document.getElementById('ratings-'+item+'-'+starCount.toString()).className = 'starOn';
for (starCount=star+1; starCount<=10; starCount++) 
{
document.getElementById('ratings-'+item+'-'+starCount.toString()).className = 'starOff';
}
}
function LockStars(item, star)
{
var starCount;
for (starCount=1; starCount<=star; starCount++) 
{
document.getElementById('ratings-'+item+'-'+starCount.toString()).className = 'starOn';
document.getElementById('ratings-'+item+'-'+starCount.toString()).onmouseover = null;
document.getElementById('ratings-'+item+'-'+starCount.toString()).onmouseout = null;
document.getElementById('ratings-'+item+'-'+starCount.toString()).onmouseup = 'javascript:void(0);';
}
for (starCount=star+1; starCount<=10; starCount++) 
{
document.getElementById('ratings-'+item+'-'+starCount.toString()).className = 'starOff';
document.getElementById('ratings-'+item+'-'+starCount.toString()).onmouseover = null;
document.getElementById('ratings-'+item+'-'+starCount.toString()).onmouseout = null;
document.getElementById('ratings-'+item+'-'+starCount.toString()).onmouseup = 'javascript:void(0);';
}
}
</script><br />
<style type="text/css">
.starOn{
background-image: url("/images/full-star.gif");
background-repeat: no-repeat;
width: 10px;
height: 10px;
}
.starOff{
background-image: url("/images/clear-star.gif");
background-repeat: no-repeat;
width: 10px;
height: 10px;
}
</style>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<div class="starOn" id="ratings-1-1" onmouseout="javascript:HoverStars('1', 1)" onmouseover="javascript:HoverStars('1', 1)" onmouseup="javascript:LockStars('1', 1)"></div>
</td>
<td>
<div class="starOff" id="ratings-1-2" onmouseout="javascript:HoverStars('1', 1)" onmouseover="javascript:HoverStars('1', 2)" onmouseup="javascript:LockStars('1', 2)"></div>
</td>
<td>
<div class="starOff" id="ratings-1-3" onmouseout="javascript:HoverStars('1', 1)" onmouseover="javascript:HoverStars('1', 3)" onmouseup="javascript:LockStars('1', 3)"></div>
</td>
<td>
<div class="starOff" id="ratings-1-4" onmouseout="javascript:HoverStars('1', 1)" onmouseover="javascript:HoverStars('1', 4)" onmouseup="javascript:LockStars('1', 4)"></div>
</td>
<td>
<div class="starOff" id="ratings-1-5" onmouseout="javascript:HoverStars('1', 1)" onmouseover="javascript:HoverStars('1', 5)" onmouseup="javascript:LockStars('1', 5)"></div>
</td>
<td>
<div class="starOff" id="ratings-1-6" onmouseout="javascript:HoverStars('1', 1)" onmouseover="javascript:HoverStars('1', 6)" onmouseup="javascript:LockStars('1', 6)"></div>
</td>
<td>
<div class="starOff" id="ratings-1-7" onmouseout="javascript:HoverStars('1', 1)" onmouseover="javascript:HoverStars('1', 7)" onmouseup="javascript:LockStars('1', 7)"></div>
</td>
<td>
<div class="starOff" id="ratings-1-8" onmouseout="javascript:HoverStars('1', 1)" onmouseover="javascript:HoverStars('1', 8)" onmouseup="javascript:LockStars('1', 8)"></div>
</td>
<td>
<div class="starOff" id="ratings-1-9" onmouseout="javascript:HoverStars('1', 1)" onmouseover="javascript:HoverStars('1', 9)" onmouseup="javascript:LockStars('1', 9)"></div>
</td>
<td>
<div class="starOff" id="ratings-1-10" onmouseout="javascript:HoverStars('1', 1)" onmouseover="javascript:HoverStars('1', 10)" onmouseup="javascript:LockStars('1', 10)"></div>
</td>
</tr>
</table>
<p> 
<p>Except we're gonna take it a step further and include the code to submit the vote (via AJAX) and return the new average rating.</p>
<p>We need 3 graphics for this tutorial: The a lit up star, a blank star, and a loading graphic. Shown below.</p>
<p> <img src="/images/full-star.gif"><img src="/images/clear-star.gif"><img src="/images/ajax-loader.gif">
<p>Next we need some CSS to style the stars for being lit up and blank:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
.starOn<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;/images/full-star.gif&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.starOff<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;/images/clear-star.gif&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>Now lets write the PHP code to display the rating stars. This code can be inserted into a PHP script where you have multiple items to rate. The $item variable must be unique. Name this file displayStars.php.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">function displayRating($item)
{
echo &quot;&lt;div id=\&quot;processingDiv-$item\&quot; style=\&quot;display:none\&quot;&gt;\n&quot;;
?&gt; 
&lt;img src=&quot;ajax-loader.gif&quot;&gt;&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;table border=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> cellpadding=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> cellspacing=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;tr&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;=</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;starOn&quot;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;starOff&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;td&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$class</span><span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>ratings-<span style="color: #006699; font-weight: bold;">$item</span>-<span style="color: #006699; font-weight: bold;">$i</span><span style="color: #000099; font-weight: bold;">\&quot;</span> onmouseout=<span style="color: #000099; font-weight: bold;">\&quot;</span>javascript:HoverStars('<span style="color: #006699; font-weight: bold;">$item</span>', 1)<span style="color: #000099; font-weight: bold;">\&quot;</span> onmouseover=<span style="color: #000099; font-weight: bold;">\&quot;</span>javascript:HoverStars('<span style="color: #006699; font-weight: bold;">$item</span>', <span style="color: #006699; font-weight: bold;">$i</span>)<span style="color: #000099; font-weight: bold;">\&quot;</span> onmouseup=<span style="color: #000099; font-weight: bold;">\&quot;</span>javascript:SubmitVote(<span style="color: #006699; font-weight: bold;">$i</span>, '<span style="color: #006699; font-weight: bold;">$item</span>')<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/div&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/td&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&lt;/table&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Notice the javascript functions for onmouseout, onmouseover, and onmouseup. onmouseout and onmouseover will handle lighting up the stars while SubmitVote() will be our javascript AJAX function to submit it to our server side script.</p>
<p>Here's all the javascript for lighting up the stars as well as the AJAX, put this in displayStars.php. This will send the rating, and ajaxSubmit will show the loadingDiv while the request is being sent and targetDiv will display the data returned from our vote.php script. targetDiv should be the name of the Div you want it to display in, so for example you may name them targtDiv-0, targetDiv-1 for item 0, 1, and so on.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> ajaxSubmit<span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> processingDiv<span style="color: #339933;">,</span> targetDiv<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
targetArea <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>targetDiv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
processingArea <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>processingDiv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> xmlHttp<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">try</span>
<span style="color: #009900;">&#123;</span> xmlHttp<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> XMLHttpRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">try</span>
  <span style="color: #009900;">&#123;</span> xmlHttp<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> ActiveXObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Msxml2.XMLHTTP'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
   <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">try</span>
     <span style="color: #009900;">&#123;</span> xmlHttp<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> ActiveXObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Microsoft.XMLHTTP'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#123;</span>
      <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Your browser does not support AJAX!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
xmlHttp.<span style="color: #660066;">onreadystatechange</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>xmlHttp.<span style="color: #660066;">readyState</span><span style="color: #339933;">==</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
    processingArea.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">;</span>
    targetArea.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> xmlHttp.<span style="color: #660066;">responseText</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
processingArea.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'block'</span><span style="color: #339933;">;</span>
xmlHttp.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span>url<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
xmlHttp.<span style="color: #660066;">send</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> SubmitVote<span style="color: #009900;">&#40;</span>vote<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> poststr <span style="color: #339933;">=</span> <span style="color: #3366CC;">'vote.php'</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'?item='</span> <span style="color: #339933;">+</span>  <span style="color: #000066; font-weight: bold;">item</span> <span style="color: #339933;">+</span> 
<span style="color: #3366CC;">'&amp;vote='</span> <span style="color: #339933;">+</span>  vote<span style="color: #339933;">;</span>
&nbsp;
LockStars<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">,</span> vote<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
ajaxSubmit<span style="color: #009900;">&#40;</span>poststr<span style="color: #339933;">,</span> <span style="color: #3366CC;">'processingDiv-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'ratingDiv-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> HoverStars<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">,</span> star<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> starCount<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>starCount<span style="color: #339933;">=</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> starCount<span style="color: #339933;">&lt;=</span>star<span style="color: #339933;">;</span> starCount<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> 
 document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ratings-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span>starCount.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'starOn'</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>starCount<span style="color: #339933;">=</span>star<span style="color: #339933;">+</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> starCount<span style="color: #339933;">&lt;=</span><span style="color: #CC0000;">10</span><span style="color: #339933;">;</span> starCount<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> 
 document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ratings-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span>starCount.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'starOff'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> LockStars<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">,</span> star<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> starCount<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>starCount<span style="color: #339933;">=</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> starCount<span style="color: #339933;">&lt;=</span>star<span style="color: #339933;">;</span> starCount<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ratings-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span>starCount.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'starOn'</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ratings-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span>starCount.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">onmouseover</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ratings-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span>starCount.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">onmouseout</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ratings-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span>starCount.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">onmouseup</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'javascript:void(0);'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>starCount<span style="color: #339933;">=</span>star<span style="color: #339933;">+</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> starCount<span style="color: #339933;">&lt;=</span><span style="color: #CC0000;">10</span><span style="color: #339933;">;</span> starCount<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>	
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ratings-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span>starCount.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'starOff'</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ratings-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span>starCount.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">onmouseover</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ratings-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span>starCount.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">onmouseout</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ratings-'</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span>starCount.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">onmouseup</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'javascript:void(0);'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p><strong>ajaxSubmit(url, processingDiv, targetDiv)</strong> submits the URL 'url' and displays the processingDiv and returns this server side script's output to targetDiv which in this case is the updated average rating.</p>
<p><strong>SubmitVote(vote, item)</strong> Takes an integer 'vote' and submits it for 'item'.</p>
<p><strong>HoverStars(item, star)</strong>Lights up the stars for 'item' up to 'star'. The function is called on onmouseout with star 1 to return it to it's initial value.</p>
<p><strong>LockStars(item, star)</strong> Locks the stars after the vote has been submitted</p>
<p>The following PHP code displays the stars for 10 items. Put this in displayStars.php.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">for ($item=0; $item&lt;=10; $item++)
 displayRating($item);
function displayRating($item)
{
echo &quot;&lt;div id=\&quot;processingDiv-$item\&quot; style=\&quot;display:none\&quot;&gt;\n&quot;;
?&gt;
&lt;img src=&quot;ajax-loader.gif&quot;&gt;&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;table border=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> cellpadding=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> cellspacing=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;tr&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;=</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;starOn&quot;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;starOff&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;td&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$class</span><span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>ratings-<span style="color: #006699; font-weight: bold;">$item</span>-<span style="color: #006699; font-weight: bold;">$i</span><span style="color: #000099; font-weight: bold;">\&quot;</span> onmouseout=<span style="color: #000099; font-weight: bold;">\&quot;</span>javascript:HoverStars('<span style="color: #006699; font-weight: bold;">$item</span>', 1)<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;onmouseover=<span style="color: #000099; font-weight: bold;">\&quot;</span>javascript:HoverStars('<span style="color: #006699; font-weight: bold;">$item</span>', <span style="color: #006699; font-weight: bold;">$i</span>)<span style="color: #000099; font-weight: bold;">\&quot;</span> onmouseup=<span style="color: #000099; font-weight: bold;">\&quot;</span>javascript:SubmitVote(<span style="color: #006699; font-weight: bold;">$i</span>, '<span style="color: #006699; font-weight: bold;">$item</span>')<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/div&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/td&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&lt;/table&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now create a database for all the items with all the fields you need (such as the item name, description, and whatever else you need) as well as an integer 'votes' and a decimal 'votesavg'.</p>
<p>The following PHP code should be in a separate PHP file for handling the server side processing of the vote. For this example I named it <strong>vote.php</strong>. Make sure that the 'item' displayed in the previous file corresponds to the item's id in the database.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$dbhost</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$dbuser</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;root&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$dbpass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;yourpassword&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;yourdatabase&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$connection</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbhost</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbuser</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbpass</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;item&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$item</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;item&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;vote&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$vote</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;vote&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">is_numeric</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$vote</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$vote</span> <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #000088;">$item</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  SubmitVote<span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">,</span> <span style="color: #000088;">$vote</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> SubmitVote<span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">,</span> <span style="color: #000088;">$vote</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$getVoteQuery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT voteavg, votes from yourtable where id = <span style="color: #006699; font-weight: bold;">$item</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$getVoteResult</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$getVoteQuery</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$currentVoteCount</span>	<span style="color: #339933;">=</span> <span style="color: #990000;">mysql_result</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$getVoteResult</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;votes&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$currentVote</span>		<span style="color: #339933;">=</span> <span style="color: #990000;">mysql_result</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$getVoteResult</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;voteavg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$newVoteCount</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$currentVoteCount</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newVote</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$currentVote</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$currentVoteCount</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #000088;">$vote</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$newVoteCount</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$newVote</span> <span style="color: #339933;">=</span> <span style="color: #990000;">Round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$newVote</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$updateVoteQuery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UPDATE `yourtable` SET `voteavg`=<span style="color: #006699; font-weight: bold;">$newVote</span>, `votes`=<span style="color: #006699; font-weight: bold;">$newVoteCount</span> WHERE id = <span style="color: #006699; font-weight: bold;">$item</span>;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$updateVoteResult</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$updateVoteQuery</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$newVote</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #990000;">mysql_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>In PHP files that serve AJAX, make sure there is no extraneous output before or after the &#60;?php ?&#62; tags as they will be returned in the AJAX request (unless of course you want it to be returned)</p>
<p>So now we have just two files our main file, displayStars.php and vote.php. When you hover your mouse over the stars, they light up and once you vote, they are locked on that rating and will not let you vote again unless you refresh.</p>
<p>The server side script takes the rating and returns the new average rating to display in the ratingDiv.</p>
<p>So lets say you have a table with a list of videos with the title, description, location, and so on you would add two extra columns, `votes` and `voteavg`. This is to keep track of how many votes there are, and what the average vote is.</p>
<p>You can download a working example below, just unzip the files and follow the directions in readme.txt.</p>
<p><a href="/files/ajax-rating-example.zip">AJAX Voting Example</a></p>
<p><strong>Conclusion and further reading</strong></p>
<p>AJAX is a powerful technology and an integral part of web 2.0. Keep an eye out for more AJAX tutorials.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ejwebdevelopment.com/how-to-create-an-ajax-based-voting-system/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Use .htaccess to Easily Mask Links</title>
		<link>http://www.ejwebdevelopment.com/how-to-use-htaccess-to-easily-mask-links/</link>
		<comments>http://www.ejwebdevelopment.com/how-to-use-htaccess-to-easily-mask-links/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 10:02:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[affiliate]]></category>

		<category><![CDATA[apache]]></category>

		<category><![CDATA[hide]]></category>

		<category><![CDATA[htaccess]]></category>

		<category><![CDATA[links]]></category>

		<category><![CDATA[mask]]></category>

		<category><![CDATA[redirect]]></category>

		<category><![CDATA[rewrite]]></category>

		<guid isPermaLink="false">http://www.ejwebdevelopment.com/how-to-use-htaccess-to-easily-mask-links/</guid>
		<description><![CDATA[This guide assumes you have already setup a website running on an Apache based webserver. If you are using IIS you will need a third party plugin such as IIS Rewrite.
Often times you may want to redirect links from your site as opposed to linking directly. This has a few benefits:

If you need to change [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>This guide assumes you have already setup a website running on an Apache based webserver. If you are using IIS you will need a third party plugin such as <a title="IIS Rewrite plugin alternative to .htaccess" href="http://www.ejwebdevelopment.com/links/iisrewrite">IIS Rewrite</a>.</p>
<p>Often times you may want to redirect links from your site as opposed to linking directly. This has a few benefits:</p>
<ul>
<li>If you need to change a link’s address you only have to change it in one spot instead of updating every page.</li>
<li>Many visitors distrust long URLs such as those used for affiliate marketing</li>
<li>Its easier to track how many people are clicking which links by using a redirect in between</li>
</ul>
<p>First, create a special directory for the .htaccess redirect file. This is to prevent from interfering with any other .htaccess files that may be on your website. Name your directory something like links/ or visit/ as this is what the visitor will see in their status bar when they hover over the link.create a .htaccess file with the following</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span>
&nbsp;
<span style="color: #adadad; font-style: italic;">#  Shopping</span>
<span style="color: #00007f;">RewriteRule</span>   ^amazon$  http://www.amazon.com
<span style="color: #00007f;">RewriteRule</span>   ^ebay$  http://www.ebay.com
<span style="color: #00007f;">RewriteRule</span>   ^newegg$  http://www.newegg.com
&nbsp;
<span style="color: #adadad; font-style: italic;">#  Search Engines</span>
<span style="color: #00007f;">RewriteRule</span>   ^google$  http://www.google.com
<span style="color: #00007f;">RewriteRule</span>   ^yahoo$  http://www.yahoo.com
<span style="color: #00007f;">RewriteRule</span>   ^msn$  https://www.msn.com
<span style="color: #00007f;">RewriteRule</span>   ^ask$  http://www.ask.com</pre></div></div>

<p>You can place a pound sign (#) to write comments and organize your links. Now, if you wanted to link to Google you would use the address http://www.yoursite.com/links/google (or whatever directory you created). Notice the (^) before and ($) after the link name.</p>
<p><strong>Conclusion and Further Reading</strong></p>
<p>.htaccess is a powerful way to manage your site. There are many more applications for .htaccess files such as password protection and migrating to a new file structure.</p>
<p>Look for a more comprehensive guide to .htaccess files here on EJ Web Development.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ejwebdevelopment.com/how-to-use-htaccess-to-easily-mask-links/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Creating Icons for Your Site</title>
		<link>http://www.ejwebdevelopment.com/creating-icons-for-your-site/</link>
		<comments>http://www.ejwebdevelopment.com/creating-icons-for-your-site/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 01:47:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[address bar]]></category>

		<category><![CDATA[bookmarks]]></category>

		<category><![CDATA[favicon]]></category>

		<category><![CDATA[icon]]></category>

		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.ejwebdevelopment.com/?p=215</guid>
		<description><![CDATA[Icons are a great way to establish an identity for your website. On nearly all browser, when you set an icon for your site it will appear next to your site's URL and next to a bookmark.
Icons are small (16x16) graphics files saved with the extension .ico. They were first used on Internet Explorer and [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Icons are a great way to establish an identity for your website. On nearly all browser, when you set an icon for your site it will appear next to your site's URL and next to a bookmark.</p>
<p>Icons are small (16x16) graphics files saved with the extension .ico. They were first used on Internet Explorer and most browsers haves ince added support for website icons. Many now even allow for different formats such as GIFs or PNGs.</p>
<p>Icons are saved as "favicon.ico" in your website's root directory. Even though many browser now support other filetypes, we're gonna stick to the more widely supported .ico format.</p>
<p>To design your own icon in photoshop, download the <a href="http://www.telegraphics.com.au/sw/">icon maker plugin</a> from telegraphics.<br />
You can use the <a href="http://www.icon-maker.com/">Easy Icon Maker</a> specifically for creating icons.<br />
You can use <a href="http://www.jhepple.com/iconmkr.htm">Fx Icon Maker</a>, also a specialty app.</p>
<p>Some of these apps allow for creating larger icons for other uses, but make sure you choose the 16x16 icon for websites. Internet explorer 5.5 and up supports 32x32 icons but there are several browsers that don't support that size.</p>
<p>If you want to create different icons for different pages of your site, put the following line of HTML in your page's header.</p>
<p><code><span style="background-color: lightgrey;">&lt;link rel="shortcut icon" href="/youricon.ico"&gt;</span></code></p>
<p>I have also created an <a title="Icon maker" href="http://www.ejwebdevelopment.com/tools/icon-maker-tool/">easy web based icon maker</a>, available under the <a title="Tools" href="http://www.ejwebdevelopment.com/tools/">tools section</a> of EJ Web Development. The tool is pretty nifty, it will take any gif, bmp, jpg, or png and resize and convert it to a favicon.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ejwebdevelopment.com/creating-icons-for-your-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>10 Dirty Little Web Development Tricks</title>
		<link>http://www.ejwebdevelopment.com/10-dirty-little-web-development-tricks/</link>
		<comments>http://www.ejwebdevelopment.com/10-dirty-little-web-development-tricks/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 05:15:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[Lists]]></category>

		<category><![CDATA[funny]]></category>

		<category><![CDATA[helpful]]></category>

		<category><![CDATA[tricks]]></category>

		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.ejwebdevelopment.com/?p=201</guid>
		<description><![CDATA[Yongfook has an interesting article titled "10 Dirt Little Web Development Tricks."
Its an entertaining short list of tricks that can help make your life a little easier and more productive.
One of my favorites on the list is to leave off the trailing ?&#62; in php files. Yongfook truly lives a life of danger.
Check out the [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Yongfook has an interesting article titled "10 Dirt Little Web Development Tricks."</p>
<p>Its an entertaining short list of tricks that can help make your life a little easier and more productive.</p>
<p>One of my favorites on the list is to leave off the trailing ?&gt; in php files. Yongfook truly lives a life of danger.</p>
<p>Check out the full article <a title="10 Dirty Little Web Development Tricks" href="http://www.yongfook.com/items/view/81/10-dirty-little-web-development-tricks">here</a>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ejwebdevelopment.com/10-dirty-little-web-development-tricks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>iPhone fart app makes $10k a day</title>
		<link>http://www.ejwebdevelopment.com/194/</link>
		<comments>http://www.ejwebdevelopment.com/194/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 11:08:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[app]]></category>

		<category><![CDATA[ifart]]></category>

		<category><![CDATA[iphone]]></category>

		<category><![CDATA[joel comm]]></category>

		<guid isPermaLink="false">http://www.ejwebdevelopment.com/?p=194</guid>
		<description><![CDATA[Everyone knows that iPhone apps are big business. The popularity of the iPhone combined with the ease of the Apple app store has created a booming market for developers.
One developer has done quite well, raking in nearly $10,000 a day, with his popular iPhone fart app.
Read the full store here.


No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Everyone knows that iPhone apps are big business. The popularity of the iPhone combined with the ease of the Apple app store has created a booming market for developers.</p>
<p>One developer has done quite well, raking in nearly $10,000 a day, with his popular iPhone fart app.</p>
<p>Read the full store <a href="http://www.edibleapple.com/ifart-developer-makes-40000-in-2-days/">here</a>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ejwebdevelopment.com/194/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Goals for EJ Web Development in 2009</title>
		<link>http://www.ejwebdevelopment.com/goals-for-ej-web-development-in-2009/</link>
		<comments>http://www.ejwebdevelopment.com/goals-for-ej-web-development-in-2009/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 10:41:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[2009]]></category>

		<category><![CDATA[ej web development]]></category>

		<category><![CDATA[goals]]></category>

		<guid isPermaLink="false">http://www.ejwebdevelopment.com/?p=191</guid>
		<description><![CDATA[EJ Web Development has come a long way in a short time. My vision is to create a website that provides information on all aspects of web development.
Here are some of my goals for the site in 2009:
Consistency
I want to average around 5 posts a week. Keeping the content flowing in the site's formative months [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>EJ Web Development has come a long way in a short time. My vision is to create a website that provides information on all aspects of web development.</p>
<p>Here are some of my goals for the site in 2009:</p>
<p><strong>Consistency</strong><br />
I want to average around 5 posts a week. Keeping the content flowing in the site's formative months will be key to it's success.</p>
<p><strong>Lists</strong><br />
I have started the affiliate and host lists already. My goal is to expand on these lists to a point where they include most of the major hosts and ad networks. Eventually I want to create a searchable database for comparing.</p>
<p><strong>The web library</strong><br />
Right now the web library is just a collection of links to useful references online, I would like to turn the web library into a single source of information for the given topics. In particular I would like to create a single source of information and examples for each technology.</p>
<p><strong>Themes and tools</strong><br />
Very soon (within the next few weeks) I will upload themes and templates I have created (for Wordpress and other apps) freeto download.</p>
<p><strong>Traffic!</strong><br />
I am always working on ways to get new traffic to the site. As I add more tutorials and references I expect the traffic to pick up even more.  I am constantly working on building new inbound links and I can see the results already.</p>
<p>Well thats it for now, it's a pretty big workload and I expect to be working on this site a lot over the next year.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ejwebdevelopment.com/goals-for-ej-web-development-in-2009/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 6.877 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-07-30 20:45:52 -->
