<?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>The Tutorial Blog &#187; PHP</title>
	<atom:link href="http://www.thetutorialblog.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetutorialblog.com</link>
	<description></description>
	<lastBuildDate>Tue, 08 Nov 2011 19:21:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<image>
<link>http://www.thetutorialblog.com</link>
<url>http://www.thetutorialblog.com/wp-content/plugins/maxblogpress-favicon/icons/favicon-28.ico</url>
<title>The Tutorial Blog</title>
</image>
		<item>
		<title>Weekly Recap (14 Feb &#8211; 21 Feb)</title>
		<link>http://www.thetutorialblog.com/general/weekly-recap-14-feb-21-feb/</link>
		<comments>http://www.thetutorialblog.com/general/weekly-recap-14-feb-21-feb/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 15:41:57 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[weekly recap]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=295</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	Here is a recap of the posts from this week. Build a Twitter-like site with CodeIgniter and jQuery Part 2 5 PHP Frameworks you may not know about Creating a basic iPad application No related posts. Related posts brought to you by Yet Another Related Posts Plugin.


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fgeneral%2Fweekly-recap-14-feb-21-feb%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fgeneral%2Fweekly-recap-14-feb-21-feb%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="Weekly Recap (14 Feb   21 Feb)" alt=" Weekly Recap (14 Feb   21 Feb)" /><br />
			</a>
		</div>
<p>Here is a recap of the posts from this week.</p>
<h2><a href="http://www.thetutorialblog.com/php/build-a-twitter-like-site-with-codeigniter-and-jquery-part-2/">Build a Twitter-like site with CodeIgniter and jQuery Part 2</a></h2>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/cijqt.jpg" alt="CodeIngiter + jQuery=twitter" title="CodeIngiter + jQuery=twitter" width="471" height="211" class="alignleft size-full wp-image-257" /></p>
<h2><a href="http://www.thetutorialblog.com/php/5-php-frameworks-you-may-not-know-about/">5 PHP Frameworks you may not know about</a></h2>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/php_logo.jpg" alt="php logo Weekly Recap (14 Feb   21 Feb)" title="php_logo" width="328" height="230" class="alignleft size-full wp-image-280" /></p>
<h2><a href="http://www.thetutorialblog.com/cocoa-objective-c/creating-a-basic-ipad-application/">Creating a basic iPad application</a></h2>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/ipad.jpg" alt="ipad Weekly Recap (14 Feb   21 Feb)" title="ipad" width="450" height="338" class="alignleft size-full wp-image-292" /></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/general/weekly-recap-14-feb-21-feb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 PHP Frameworks you may not know about</title>
		<link>http://www.thetutorialblog.com/php/5-php-frameworks-you-may-not-know-about/</link>
		<comments>http://www.thetutorialblog.com/php/5-php-frameworks-you-may-not-know-about/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 14:55:30 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[lists]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[akelos]]></category>
		<category><![CDATA[akelos php framework]]></category>
		<category><![CDATA[auth module]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[DB Objects]]></category>
		<category><![CDATA[framework tutorial]]></category>
		<category><![CDATA[kohana]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[mutiple databases]]></category>
		<category><![CDATA[ORM]]></category>
		<category><![CDATA[php framework tutorial]]></category>
		<category><![CDATA[php frameworks]]></category>
		<category><![CDATA[php on trax]]></category>
		<category><![CDATA[php on trax framework]]></category>
		<category><![CDATA[php4]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[PRADO]]></category>
		<category><![CDATA[PRADO php framework]]></category>
		<category><![CDATA[seagull]]></category>
		<category><![CDATA[seagull php framework]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[yii]]></category>
		<category><![CDATA[yii php framework]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=263</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	There are many PHP frameworks available for developers to choose from when creating a project. Frameworks such as CodeIgniter, CakePHP, Symfony and Zend are the most popular frameworks used by developers. In this article I will compile a list of 5 frameworks that many developers may not know of. Seagull Supports: PHP4 PHP5 Multiple Database's [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2F5-php-frameworks-you-may-not-know-about%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2F5-php-frameworks-you-may-not-know-about%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="5 PHP Frameworks you may not know about" alt=" 5 PHP Frameworks you may not know about" /><br />
			</a>
		</div>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/php_logo.jpg" alt="php logo 5 PHP Frameworks you may not know about" title="php_logo" width="328" height="230" class="alignleft size-full wp-image-280" /><br />
There are many PHP frameworks available for developers to choose from when creating a project. Frameworks such as <a href="http://codeigniter.com">CodeIgniter</a>, <a href="http://www.cakephp.org">CakePHP</a>, <a href="http://www.symfony-project.org/">Symfony</a> and <a href="http://framework.zend.com/">Zend</a> are the most popular frameworks used by developers.</p>
<p>In this article I will compile a list of 5 frameworks that many developers may not know of.<br />
<span id="more-263"></span></p>
<h2><a href="http://seagullproject.org/">Seagull</a></h2>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/Seagull.jpg" alt="Seagull 5 PHP Frameworks you may not know about" title="Seagull" width="300" height="75" class="alignleft size-full wp-image-275" /><br />
Supports:</p>
<ul>
<li>PHP4</li>
<li>PHP5</li>
<li>Multiple Database's</li>
<li>ORM</li>
<li>DB Objects</li>
<li>Templates</li>
<li>Caching</li>
<li>Validation</li>
<li>Ajax</li>
<li>Auth Module</li>
<li>Modules</li>
</ul>
<h2><a href="http://www.phpontrax.com/">PHP on TRAX</a></h2>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/phpontrax.jpg" alt="phpontrax 5 PHP Frameworks you may not know about" title="phpontrax" width="187" height="194" class="alignleft size-full wp-image-277" /><br />
Supports:</p>
<ul>
<li>PHP5</li>
<li>Multiple Database's</li>
<li>ORM</li>
<li>DB Objects</li>
<li>Validation</li>
<li>Ajax</li>
<li>Modules</li>
</ul>
<h2><a href="http://www.yiiframework.com/">Yii</a></h2>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/Yii.jpg" alt="Yii 5 PHP Frameworks you may not know about" title="Yii" width="430" height="55" class="alignleft size-full wp-image-278" /><br />
Supports:</p>
<ul>
<li>PHP5</li>
<li>Multiple Database's</li>
<li>ORM</li>
<li>DB Objects</li>
<li>Templates</li>
<li>Caching</li>
<li>Validation</li>
<li>Ajax</li>
<li>Auth Module</li>
<li>Modules</li>
</ul>
<h2><a href="http://www.akelos.org/">Akelos</a></h2>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/Akelos.jpg" alt="Akelos 5 PHP Frameworks you may not know about" title="Akelos" width="225" height="115" class="alignleft size-full wp-image-279" /><br />
Supports:</p>
<ul>
<li>PHP4</li>
<li>PHP5</li>
<li>Multiple Database's</li>
<li>ORM</li>
<li>DB Objects</li>
<li>Templates</li>
<li>Caching</li>
<li>Validation</li>
<li>Ajax</li>
<li>Auth Module</li>
<li>Modules</li>
</ul>
<h2><a href="http://www.pradosoft.com/">Prado</a></h2>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/PRADO.jpg" alt="PRADO 5 PHP Frameworks you may not know about" title="PRADO" width="540" height="50" class="alignleft size-full wp-image-276" /><br />
Supports:</p>
<ul>
<li>PHP5</li>
<li>Multiple Database's</li>
<li>ORM</li>
<li>DB Objects</li>
<li>Templates</li>
<li>Caching</li>
<li>Validation</li>
<li>Ajax</li>
<li>Auth Module</li>
<li>Modules</li>
</ul>
<h2>Other frameworks</h2>
<p>If there are other frameworks that you know of that you think I have missed then please feel free to post a comment.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/php/5-php-frameworks-you-may-not-know-about/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>10 Awesome jQuery Tutorials You Should Check Out</title>
		<link>http://www.thetutorialblog.com/jquery/10-awesome-jquery-tutorials-you-should-check-out/</link>
		<comments>http://www.thetutorialblog.com/jquery/10-awesome-jquery-tutorials-you-should-check-out/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 14:02:53 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[carousel]]></category>
		<category><![CDATA[codeingiter]]></category>
		<category><![CDATA[digg-style]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[jquery suggestions]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[scrolling menu]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=222</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	jQuery is a great tool that everyone in web development should be using to make the functionality of their websites better, it's easy of use and good documentation is what makes jQuery such a successful framework. Although the documentation is good there are still a lot of tutorials out there that you should check out. [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fjquery%2F10-awesome-jquery-tutorials-you-should-check-out%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fjquery%2F10-awesome-jquery-tutorials-you-should-check-out%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="10 Awesome jQuery Tutorials You Should Check Out" alt=" 10 Awesome jQuery Tutorials You Should Check Out" /><br />
			</a>
		</div>
<p><img class="alignleft size-full wp-image-224" title="jquery-logo" src="http://www.thetutorialblog.com/wp-content/uploads/2010/02/jquery-logo.gif" alt="jquery logo 10 Awesome jQuery Tutorials You Should Check Out" width="320" height="220" /></p>
<p>jQuery is a great tool that everyone in web development should be using to make the functionality of their websites better, it's easy of use and good documentation is what makes jQuery such a successful framework. Although the documentation is good there are still a lot of tutorials out there that you should check out.</p>
<p><span id="more-222"></span></p>
<ol>
<li>
<h2><a href="http://www.thetutorialblog.com/text-tutorials/quick-tip-resolving-conflicting-problems-between-jquery-and-mootools-or-any-other-javascript-library/">Quick Tip: Resolving conflicting problems between jQuery and MooTools or any other Javascript library</a></h2>
</li>
<li>
<h2><a href="http://www.thetutorialblog.com/php/twitter-like-pagination-using-codeigniter-and-jquery/">Twitter-like pagination using CodeIgniter and jQuery</a></h2>
</li>
<li>
<h2><a href="http://www.thetutorialblog.com/php/php-gallery-with-no-page-reloads-using-jquery/">PHP gallery with no page reloads using jQuery</a></h2>
</li>
<li>
<h2><a href="http://www.thetutorialblog.com/jquery/jquery-dropdown-suggestions/">jQuery Dropdown Suggestions</a></h2>
</li>
<li>
<h2><a href="http://www.thetutorialblog.com/php/twitter-like-pagination-using-cakephp-and-jquery/">Twitter-like pagination using CakePHP and jQuery</a></h2>
</li>
<li>
<h2><a href="http://valums.com/scroll-menu-jquery/">Create a Scrolling Menu with CSS and jQuery</a></h2>
</li>
<li>
<h2><a href="http://marcgrabanski.com/article/jquery-google-maps-tutorial-basics">jQuery and Google Maps Tutorial</a></h2>
</li>
<li>
<h2><a href="http://net.tutsplus.com/tutorials/javascript-ajax/inettuts/">How to Mimic the iGoogle Interface</a></h2>
</li>
<li>
<h2><a href="http://jqueryfordesigners.com/jquery-infinite-carousel/">jQuery Infinite Carousel</a></h2>
</li>
<li>
<h2><a href="http://www.queness.com/post/309/create-a-digg-style-post-sharing-tool-with-jquery">Create a Digg-style post sharing tool with jQuery</a></h2>
</li>
</ol>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/jquery/10-awesome-jquery-tutorials-you-should-check-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP gallery with no page reloads using jQuery</title>
		<link>http://www.thetutorialblog.com/php/php-gallery-with-no-page-reloads-using-jquery/</link>
		<comments>http://www.thetutorialblog.com/php/php-gallery-with-no-page-reloads-using-jquery/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 18:02:09 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Text Tutorials]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[image gallery]]></category>
		<category><![CDATA[image gallery using ajax]]></category>
		<category><![CDATA[imgbrowz0r]]></category>
		<category><![CDATA[php image gallery]]></category>
		<category><![CDATA[prettyPhoto]]></category>
		<category><![CDATA[thetutorialblog]]></category>
		<category><![CDATA[wez pyke]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=173</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	For this tutorial we will be using the ImgBrowz0r class for the backend of the gallery, we will then write a jQuery script so that we can browse through the gallery created by ImgBrowz0r without no page reloads and a nice effect between page requests so the user knows the page has changed. We will [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fphp-gallery-with-no-page-reloads-using-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fphp-gallery-with-no-page-reloads-using-jquery%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="PHP gallery with no page reloads using jQuery" alt=" PHP gallery with no page reloads using jQuery" /><br />
			</a>
		</div>
<p><img src="http://www.thetutorialblog.com/wp-content/uploads/2009/12/jquery_gallery.jpg" alt="jquery gallery PHP gallery with no page reloads using jQuery" title="jquery_gallery" width="300" height="300" class="alignleft size-full wp-image-174" />For this tutorial we will be using the <a href="http://61924.nl/projects/imgbrowz0r.html">ImgBrowz0r</a> class for the backend of the gallery, we will then write a jQuery script so that we can browse through the gallery created by ImgBrowz0r without no page reloads and a nice effect between page requests so the user knows the page has changed. We will also be using the <a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/">prettyPhoto plugin</a> for jQuery to open up the actual images.</p>
<h2>Getting ImgBrowz0r and prettyPhoto to work</h2>
<p>The first thing I done was create a folder called jquery_gallery inside here is where all the files and folders are gonna be stored. I then created 4 folders inside jquery_gallery, the folders are called css, images, inc and js.</p>
<p>When you have downloaded the ImgBrowz0r class, copy the file into the inc folder.<br />
<span id="more-173"></span><br />
Now inside the images folder create 2 folders cache and gallery. After you have unzipped prettyPhoto goto the images folder and inside the images folder copy the folder named prettyPhoto to our image folder. There should now be 3 folders inside our images folder cache, gallery and prettyPhoto.</p>
<p>Inside our css folder that we have created we will copy the css file from the prettyPhoto css folder named prettyPhoto.css.</p>
<p>The last thing to do for prettyPhoto is to copy the javascript file from the prettyPhoto js folder to our js folder.</p>
<p>So now we should have a file structure like so:<br />
|css<br />
|--prettyPhoto.css</p>
<p>|images<br />
|--cache<br />
|--gallery<br />
|--prettyPhoto</p>
<p>|inc<br />
|--imgbrowz0r.php</p>
<p>|js<br />
|--jquery.prettyPhoto.js</p>
<p>We need to also create a css file for our imgBrowz0r class, create a css file inside our css folder and name it gallery.css. Copy the code into this file that is below:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">strong <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* This is some example CSS. You can change this to your own liking. */</span>
	<span style="color: #6666ff;">.img-description</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.imgbrowz0r-navigation</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span> <span style="color: #933;">970px</span><span style="color: #00AA00;">;</span>text-align<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.imgbrowz0r-navigation</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.5em</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">0.5em</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.imgbrowz0r-navigation</span> <span style="color: #6666ff;">.img-statistics</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.5em</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #6666ff;">.img-description</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.5em</span> <span style="color: #993333;">auto</span> <span style="color: #cc66cc;">0</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-row</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1em</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> a<span style="color: #3333ff;">:link</span><span style="color: #00AA00;">,</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> a<span style="color: #3333ff;">:visited </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Georgia<span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Times New Roman&quot;</span><span style="color: #00AA00;">,</span> Times<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>text-decoration<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-thumbnail</span> a<span style="color: #3333ff;">:link </span>img<span style="color: #00AA00;">,</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-thumbnail</span> a<span style="color: #3333ff;">:visited </span>img <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-thumbnail</span> a<span style="color: #3333ff;">:hover </span>img<span style="color: #00AA00;">,</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-thumbnail</span> a<span style="color: #3333ff;">:active </span>img <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> a<span style="color: #3333ff;">:link</span><span style="color: #00AA00;">,</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> a<span style="color: #3333ff;">:visited </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>font-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.5em</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ccc</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> a<span style="color: #3333ff;">:active </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> span.img-dir-name<span style="color: #00AA00;">,</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> span<span style="color: #6666ff;">.img-thumb-date</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> span<span style="color: #6666ff;">.img-dir-name</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>font-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.2em</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-thumbnail</span> a<span style="color: #00AA00;">,</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #cc00cc;">#imgbrowz0r</span> .img-thumbnail<span style="color: #00AA00;">,</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>padding<span style="color: #00AA00;">:</span> <span style="color: #933;">1.5em</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">25</span>%</span><span style="color: #00AA00;">;</span>text-align<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-column-1</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> a<span style="color: #3333ff;">:link</span><span style="color: #00AA00;">,</span>
	<span style="color: #cc00cc;">#imgbrowz0r</span> <span style="color: #6666ff;">.img-directory</span> a<span style="color: #3333ff;">:visited </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">160px</span><span style="color: #00AA00;">;</span>line-<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</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>background-<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">50</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;">50</span>%</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* http://sonspring.com/journal/clearing-floats */</span>
	html body div.<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">,</span>
	html body span<span style="color: #6666ff;">.clear</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>clear<span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>display<span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>font-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>list-style<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
			       <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>padding<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>overflow<span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>visibility<span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>height<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Create a file called index.php in the root of our folder and copy in the basic html.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
	&lt;title&gt;TheTutorialBlog.com | Photo Gallery&lt;/title&gt;
	&lt;script src=&quot;http://www.google.com/jsapi&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
	google.load(&quot;jquery&quot;, &quot;1.3.2&quot;);
	&lt;/script&gt;
	&lt;link rel=&quot;stylesheet&quot; href=&quot;css/prettyPhoto.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; title=&quot;no title&quot; charset=&quot;utf-8&quot;&gt;
	&lt;link rel=&quot;stylesheet&quot; href=&quot;css/gallery.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; title=&quot;no title&quot; charset=&quot;utf-8&quot;&gt;
	&lt;script src=&quot;js/jquery.prettyPhoto.js&quot;&gt;&lt;/script&gt;
&nbsp;
	&lt;script&gt;
		$(document).ready(function(){
		// prettyPhoto
			$(&quot;a[rel^='prettyPhoto']&quot;).prettyPhoto({
				showTitle: false
			});
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;content_main&quot;&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>Inside the div called content_main is where our the ImgBrowz0r class code will go.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'inc/imgbrowz0r.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// These are all settings (set to default). The settings are not validated since you have to configure everything.</span>
<span style="color: #666666; font-style: italic;">// There is a chance that ImgBrowz0r stops working if you enter the wrong values.</span>
<span style="color: #000088;">$config</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #666666; font-style: italic;">// Directory settings. These are required. Without trailing slash. (required)</span>
	<span style="color: #0000ff;">'images_dir'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'images/gallery'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'cache_dir'</span>                <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'images/cache'</span><span style="color: #339933;">,</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Url settings. These are required. Without trailing slash. (required)</span>
	<span style="color: #666666; font-style: italic;">// %PATH% is replaced with the directory location and page number</span>
	<span style="color: #0000ff;">'main_url'</span>                 <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'http://localhost:8888/tutorials/jquery_gallery/index.php?q=%PATH%'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'images_url'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'http:///localhost:8888/tutorials/jquery_gallery/images/gallery'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'cache_url'</span>                <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'http:///localhost:8888/tutorials/jquery_gallery/images/cache'</span><span style="color: #339933;">,</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Sorting settings (optional)</span>
	<span style="color: #0000ff;">'sort_by'</span>                  <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// 1 = filename, 2 = extension (png, gif, etc.), 3 = inode change time of file</span>
	<span style="color: #0000ff;">'sort_order'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// true = ascending, false = descending</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Thumbnail settings (optional)</span>
	<span style="color: #0000ff;">'thumbs_per_page'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">12</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Amount of thumbnails per page</span>
	<span style="color: #0000ff;">'max_thumb_row'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Amount of thumbnails on a row</span>
	<span style="color: #0000ff;">'max_thumb_width'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">200</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Maximum width of thumbnail</span>
	<span style="color: #0000ff;">'max_thumb_height'</span>         <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">200</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Maximum height of thumbnail</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Time settings (optional)</span>
	<span style="color: #0000ff;">'time_format'</span>              <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'F jS, Y'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Date formatting. Look at the PHP date() for help: http://nl3.php.net/manual/en/function.date.php</span>
	<span style="color: #0000ff;">'time_zone'</span>                <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Timezone. Example: 1</span>
	<span style="color: #0000ff;">'enable_dst'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Daylight saving time (DST). Set this to true to enable it.</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Misc settings (optional)</span>
	<span style="color: #0000ff;">'ignore_port'</span>              <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Ignore port in url. Set this to true to ignore the port.</span>
	<span style="color: #0000ff;">'dir_thumbs'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Show a thumbnail in a category box. Default is false.</span>
	<span style="color: #0000ff;">'random_thumbs'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Use random thumbnails for categories. Default is false.</span>
	<span style="color: #0000ff;">'read_thumb_limit'</span>         <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #666666; font-style: italic;">// See README for information about this setting.</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Start the class</span>
<span style="color: #000088;">$gallery</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> imgbrowz0r<span style="color: #009900;">&#40;</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// Prepare everything. This function must be called before you call other functions.</span>
<span style="color: #000088;">$gallery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Generate navigation and statistics</span>
<span style="color: #000088;">$gallery_breadcrumbs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$gallery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">breadcrumbs</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$gallery_pagination</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$gallery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pagination</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// Display navigation</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;imgbrowz0r-navigation&quot;&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gallery_breadcrumbs</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gallery_pagination</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Display images and directories</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$gallery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">browse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Display navigation</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;imgbrowz0r-navigation&quot;&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gallery_pagination</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gallery_breadcrumbs</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Fill in the information for the main_url, images_url and cache_url or it will not work.</p>
<p>In the imgBrowz0r.php file located in inc find line number 205 and add a rel called prettyPhoto:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cur_directory</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&quot; title=&quot;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&quot; rel=&quot;prettyPhoto&quot;&gt;&lt;img src=&quot;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cache_url'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span></pre></div></div>

<p>If we do not do this then the jQuery prettyPhoto plugin will not work.</p>
<h2>Navigating through the gallery without page reloads</h2>
<p>To do this we need to write our own jQuery code so that when a hyperlink inside the gallery div then we will do an ajax call that will then replace the content in the content_main div.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.img-directory a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</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: #660066;">get</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#content_main&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#content_main&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#content_main&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</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;">&#41;</span></pre></div></div>

<p>So when a hyperlink inside the a div with the class called img-directory is clicked we will get the href from the hyperlink and retrieve that page using $.get(). We will then slide up the element until the content has loaded and then the elemnt will slide back down and contain the content we requested. We also return false so that the page does not reload.</p>
<p>We do the same for the breadcrumbs so we can navigate between them without the page refreshing also:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.img-breadcrumbs'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</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: #660066;">get</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#content_main&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#content_main&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#content_main&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</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;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The entire index.php page should look like so:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
	&lt;title&gt;TheTutorialBlog.com | Photo Gallery&lt;/title&gt;
	&lt;script src=&quot;http://www.google.com/jsapi&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
	google.load(&quot;jquery&quot;, &quot;1.3.2&quot;);
	&lt;/script&gt;
	&lt;link rel=&quot;stylesheet&quot; href=&quot;css/prettyPhoto.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; title=&quot;no title&quot; charset=&quot;utf-8&quot;&gt;
	&lt;link rel=&quot;stylesheet&quot; href=&quot;css/gallery.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; title=&quot;no title&quot; charset=&quot;utf-8&quot;&gt;
	&lt;script src=&quot;js/jquery.prettyPhoto.js&quot;&gt;&lt;/script&gt;
&nbsp;
	&lt;script&gt;
		$(document).ready(function(){
		// prettyPhoto
			$(&quot;a[rel^='prettyPhoto']&quot;).prettyPhoto({
				showTitle: false
			});
&nbsp;
			$('.img-directory a').click(function(){
				$.get($(this).attr(&quot;href&quot;), function(data){
					$(&quot;#content_main&quot;).slideUp(&quot;slow&quot;, function(){
					$(&quot;#content_main&quot;).html(data)}), $(&quot;#content_main&quot;).slideDown()
				});
				return false;
			})
&nbsp;
			$('.img-breadcrumbs').click(function(){
				$.get($(this).attr(&quot;href&quot;), function(data){
					$(&quot;#content_main&quot;).slideUp(&quot;slow&quot;, function(){
					$(&quot;#content_main&quot;).html(data)}), $(&quot;#content_main&quot;).slideDown()
				});
				return false;
			});
		});
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'inc/imgbrowz0r.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// These are all settings (set to default). The settings are not validated since you have to configure everything.</span>
<span style="color: #666666; font-style: italic;">// There is a chance that ImgBrowz0r stops working if you enter the wrong values.</span>
<span style="color: #000088;">$config</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #666666; font-style: italic;">// Directory settings. These are required. Without trailing slash. (required)</span>
	<span style="color: #0000ff;">'images_dir'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'images/gallery'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'cache_dir'</span>                <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'images/cache'</span><span style="color: #339933;">,</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Url settings. These are required. Without trailing slash. (required)</span>
	<span style="color: #666666; font-style: italic;">// %PATH% is replaced with the directory location and page number</span>
	<span style="color: #0000ff;">'main_url'</span>                 <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'http://localhost:8888/tutorials/jquery_gallery/index.php?q=%PATH%'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'images_url'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'http:///localhost:8888/tutorials/jquery_gallery/images/gallery'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'cache_url'</span>                <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'http:///localhost:8888/tutorials/jquery_gallery/images/cache'</span><span style="color: #339933;">,</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Sorting settings (optional)</span>
	<span style="color: #0000ff;">'sort_by'</span>                  <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// 1 = filename, 2 = extension (png, gif, etc.), 3 = inode change time of file</span>
	<span style="color: #0000ff;">'sort_order'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// true = ascending, false = descending</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Thumbnail settings (optional)</span>
	<span style="color: #0000ff;">'thumbs_per_page'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">12</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Amount of thumbnails per page</span>
	<span style="color: #0000ff;">'max_thumb_row'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Amount of thumbnails on a row</span>
	<span style="color: #0000ff;">'max_thumb_width'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">200</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Maximum width of thumbnail</span>
	<span style="color: #0000ff;">'max_thumb_height'</span>         <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">200</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Maximum height of thumbnail</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Time settings (optional)</span>
	<span style="color: #0000ff;">'time_format'</span>              <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'F jS, Y'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Date formatting. Look at the PHP date() for help: http://nl3.php.net/manual/en/function.date.php</span>
	<span style="color: #0000ff;">'time_zone'</span>                <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Timezone. Example: 1</span>
	<span style="color: #0000ff;">'enable_dst'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Daylight saving time (DST). Set this to true to enable it.</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Misc settings (optional)</span>
	<span style="color: #0000ff;">'ignore_port'</span>              <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Ignore port in url. Set this to true to ignore the port.</span>
	<span style="color: #0000ff;">'dir_thumbs'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Show a thumbnail in a category box. Default is false.</span>
	<span style="color: #0000ff;">'random_thumbs'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Use random thumbnails for categories. Default is false.</span>
	<span style="color: #0000ff;">'read_thumb_limit'</span>         <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #666666; font-style: italic;">// See README for information about this setting.</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Start the class</span>
<span style="color: #000088;">$gallery</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> imgbrowz0r<span style="color: #009900;">&#40;</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// Prepare everything. This function must be called before you call other functions.</span>
<span style="color: #000088;">$gallery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Generate navigation and statistics</span>
<span style="color: #000088;">$gallery_breadcrumbs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$gallery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">breadcrumbs</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$gallery_pagination</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$gallery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pagination</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;div id=&quot;content_main&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// Display navigation</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;imgbrowz0r-navigation&quot;&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gallery_breadcrumbs</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gallery_pagination</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Display images and directories</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$gallery</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">browse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Display navigation</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;imgbrowz0r-navigation&quot;&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gallery_pagination</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gallery_breadcrumbs</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;&lt;!--content_main--&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<h2>Download</h2>
<p>You can download the files used in this tutorial <a href="http://www.thetutorialblog.com/files/tutorials/jquery_gallery.zip">here</a></p>
<h2>Final words</h2>
<p>I hope this tutorial has been useful for you and that you can take something you have learnt from it and use it in future projects.</p>
<p>Please feel free to leave a comment.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/php/php-gallery-with-no-page-reloads-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful websites and resources for learning CodeIgniter</title>
		<link>http://www.thetutorialblog.com/php/useful-websites-and-resources-for-learning-codeigniter/</link>
		<comments>http://www.thetutorialblog.com/php/useful-websites-and-resources-for-learning-codeigniter/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 02:01:55 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[list]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=157</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	Frameworks are becoming more and more popular because of the useful pre-built functions and organization of how files are meant to be stored and used. Here is a shortlist of 10 resources that should be useful for beginners looking to learn CodeIgniter. CodeIgniter From Scratch From CodeIgniter to Ruby on Rails: A Conversion Smarty as [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fuseful-websites-and-resources-for-learning-codeigniter%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fuseful-websites-and-resources-for-learning-codeigniter%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="Useful websites and resources for learning CodeIgniter" alt=" Useful websites and resources for learning CodeIgniter" /><br />
			</a>
		</div>
<p><a title="Framework" href="http://en.wikipedia.org/wiki/Software_framework">Frameworks</a> are becoming more and more popular because of the useful pre-built functions and organization of how files are meant to be stored and used.</p>
<p>Here is a shortlist of 10 resources that should be useful for beginners looking to learn <a title="CodeIgniter" href="http://codeigniter.com/">CodeIgniter</a>.</p>
<ol>
<li><a title="CodeIgniter From Scratch" href="http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-1/">CodeIgniter From Scratch</a></li>
<li><a title="From CodeIgniter to Ruby on Rails: A Conversion" href="http://net.tutsplus.com/tutorials/ruby/from-codeigniter-to-ruby-on-rails-a-conversion/">From CodeIgniter to Ruby on Rails: A Conversion</a></li>
<li><a title="Smarty as a template engine in Code Igniter" href="http://www.devcha.com/2007/12/smarty-as-template-engine-in-code.html">Smarty as a template engine in Code Igniter</a></li>
<li><a title="CodeIgniter Sample Auto-Complete Application" href="http://video.derekallard.com/">CodeIgniter Sample Auto-Complete Application</a></li>
<li><a title="Everything You Need to Get Started With CodeIgniter " href="http://www.abangyasir.com/with-all-extra-module/67-everything-you-need-to-get-started-with-codeigniter.html">Everything You Need to Get Started With CodeIgniter </a></li>
<li><a title="A Quick Code Igniter and JQuery Ajax Tutorial" href="http://www.mrforbes.com/thoughts/2009/01/28/a-quick-code-igniter-and-jquery-ajax-tutorial/">A Quick Code Igniter and JQuery Ajax Tutorial</a></li>
<li><a title="Speed Up your Web Application by CodeIgniter" href="http://saidur.wordpress.com/2008/05/03/speed-up-your-web-application-by-codeigniter/">Speed Up your Web Application by CodeIgniter</a></li>
<li><a title="How to use CodeIgniter’s OpenID library to integrate OpenID in your existing user system." href="http://thinkmoult.com/2009/02/22/use-codeigniter-openid-library-to-integrate-openid/">How to use CodeIgniter’s OpenID library to integrate OpenID in your existing user system.</a></li>
<li><a title="Pagination with Code Igniter" href="http://godbit.com/article/pagination-with-code-igniter">Pagination with Code Igniter</a></li>
<li><a title="CodeIgniter User Guide" href="http://codeigniter.com/user_guide/">CodeIgniter User Guide</a></li>
</ol>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/php/useful-websites-and-resources-for-learning-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uploading files to Rackspace Cloud (Mosso) using PHP API</title>
		<link>http://www.thetutorialblog.com/php/uploading-files-to-rackspace-cloud-mosso-using-php-api/</link>
		<comments>http://www.thetutorialblog.com/php/uploading-files-to-rackspace-cloud-mosso-using-php-api/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 00:39:45 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Text Tutorials]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[mosso]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=142</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	Rackspace Cloud is a great VPS service, but when I recently done a project it needed the functionality of uploading directly from a website to the cloud. I did not find many tutorials on how to do this, so I thought I'd write a tutorial on it myself. Step 1: Download the required files The [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fuploading-files-to-rackspace-cloud-mosso-using-php-api%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fuploading-files-to-rackspace-cloud-mosso-using-php-api%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="Uploading files to Rackspace Cloud (Mosso) using PHP API" alt=" Uploading files to Rackspace Cloud (Mosso) using PHP API" /><br />
			</a>
		</div>
<p><a title="Rackspace Cloud" href="http://www.rackspacecloud.com/">Rackspace Cloud</a> is a great <a title="VPS ( Virtual Private Server )" href="http://en.wikipedia.org/wiki/Virtual_private_server">VPS</a> service, but when I recently done a project it needed the functionality of uploading directly from a website to the cloud. I did not find many tutorials on how to do this, so I thought I'd write a tutorial on it myself.</p>
<h2>Step 1: Download the required files</h2>
<p>The files you will need for this are located at the Rackspace Cloud website <a title="API Files" href="http://www.rackspacecloud.com/cloud_hosting_products/files/#filesAPI">here</a>. You can download the API for <a href="http://www.php.net">PHP</a>, <a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a>, <a href="http://www.python.org/">Python</a>, <a href="http://en.wikipedia.org/wiki/.NET_Framework">.NET</a> and <a href="http://www.ruby-lang.org/en/">Ruby</a>. But for this tutorial we will be using PHP.<br />
<span id="more-142"></span></p>
<h2>Step 2: Setup</h2>
<p>When the download of the PHP API has complete decompress the file and rename it to cloudfiles. Now place the folder named <em>cloudfiles </em>in the directory where the PHP files will be stored that will upload to the Rackspace Cloud.</p>
<h2>Step 3: Create an upload form</h2>
<p>For this tutorial we will only be creating a basic upload form, but I have planned for a more advanced uploader with a progress bar and multiple file uploads for a future tutorial, so be sure to check back for that.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form action=&quot;upload.php&quot; enctype=&quot;multipart/form-data&quot; method=&quot;POST&quot;&gt;
File: &lt;input name=&quot;upload&quot; type=&quot;file&quot; /&gt; 
&nbsp;
&lt;input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;Upload To Rackspace!&quot; /&gt;
&lt;/form&gt;</pre></div></div>

<p>Name this file <em>upload.html</em></p>
<h2>Step 4: Uploading to Rackspace Cloud</h2>
<p>So what we need to do to upload to the Rackspace cloud is to include the PHP API, connect to Rackspace, get the container we want to use, create an object and then upload the file to that object.</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: #666666; font-style: italic;">// include the API</span>
<span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cloudfiles/cloudfiles.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// cloud info</span>
<span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// username</span>
<span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// api key</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Connect to Rackspace</span>
<span style="color: #000088;">$auth</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CF_Authentication<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$auth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">authenticate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$conn</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CF_Connection<span style="color: #009900;">&#40;</span><span style="color: #000088;">$auth</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get the container we want to use</span>
<span style="color: #000088;">$container</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$conn</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_container</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ContainerName'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// store file information</span>
<span style="color: #000088;">$localfile</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'upload'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'tmp_name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'upload'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// upload file to Rackspace</span>
<span style="color: #000088;">$object</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$container</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">create_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filename</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$object</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load_from_filename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$localfile</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Name this file <em>upload.php</em>.</p>
<h2>Download</h2>
<p>You can download the source files from <a title="Rackspace Cloud Upload source files" href="http://www.thetutorialblog.com/files/tutorials/rackspace_cloud_upload.zip">here</a></p>
<h2>Post a comment</h2>
<p>Please post a comment and let us know if you have anything that you'd like to add to the tutorial or if you are having any problems.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/php/uploading-files-to-rackspace-cloud-mosso-using-php-api/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Send form data to PHP without the whole page reloading using jQuery</title>
		<link>http://www.thetutorialblog.com/php/send-form-data-to-php-without-the-whole-page-reloading-using-jquery/</link>
		<comments>http://www.thetutorialblog.com/php/send-form-data-to-php-without-the-whole-page-reloading-using-jquery/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 00:43:14 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Text Tutorials]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[nettuts]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[screenr]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=121</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	This is my screencast for the Nettuts/Screenr screencast competition. I feel as though I rushed it because I had to do it under 5 minutes but I hope you learn a thing or two from it. Source Files No related posts. Related posts brought to you by Yet Another Related Posts Plugin.


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fsend-form-data-to-php-without-the-whole-page-reloading-using-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fsend-form-data-to-php-without-the-whole-page-reloading-using-jquery%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="Send form data to PHP without the whole page reloading using jQuery" alt=" Send form data to PHP without the whole page reloading using jQuery" /><br />
			</a>
		</div>
<p>This is my screencast for the Nettuts/Screenr screencast competition. I feel as though I rushed it because I had to do it under 5 minutes but I hope you learn a thing or two from it.</p>
<p><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='560' height='345'><param name='movie' value='http://screenr.com/Content/assets/screenr_0817090731.swf' /><param name='flashvars' value='i=10656' /><param name='allowFullScreen' value='true' /><embed src='http://screenr.com/Content/assets/screenr_0817090731.swf' flashvars='i=10656' allowFullScreen='true' width='560' height='345' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object></p>
<p><a href="http://www.thetutorialblog.com/files/tutorials/jquery_form.zip">Source Files</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/php/send-form-data-to-php-without-the-whole-page-reloading-using-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Contact Form</title>
		<link>http://www.thetutorialblog.com/php/php-contact-form/</link>
		<comments>http://www.thetutorialblog.com/php/php-contact-form/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 17:35:32 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Text Tutorials]]></category>
		<category><![CDATA[contact form]]></category>
		<category><![CDATA[the tutorial blog]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=95</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	Every website needs a way of contacting the people behind it and putting an email on a page is not such a good idea; because bots can easily pick up this email address and send spam to it. This is where a contact form comes in very useful because people can send you messages but [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fphp-contact-form%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fphp-contact-form%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="PHP Contact Form" alt=" PHP Contact Form" /><br />
			</a>
		</div>
<p>Every website needs a way of contacting the people behind it and putting an email on a page is not such a good idea; because bots can easily pick up this email address and send spam to it. This is where a contact form comes in very useful because people can send you messages but do not get your email address.<span id="more-95"></span></p>
<p>For a contact form the first thing that we need to do is to create a form using HTML so that they can input their information and message that they are going to send.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form action=&quot;send_message.php&quot; method=&quot;POST&quot;&gt;
	Name: &lt;input type=&quot;text&quot; name=&quot;name&quot;&gt; &lt;br /&gt;
	Email: &lt;input type=&quot;text&quot; name=&quot;email&quot;&gt; &lt;br /&gt;
	Message: &lt;textarea name=&quot;message&quot;&gt;&lt;/textarea&gt; &lt;br /&gt;
	&lt;input type=&quot;submit&quot; name=&quot;send_message&quot; value=&quot;Send!&quot;&gt;
&lt;/form&gt;</pre></div></div>

<p>When the press send it will then go to a page called send_message.php. This page will grab the information that they input and send it to an email address using the mail() function in PHP.</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;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'your_address@your_email.com'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;New message from <span style="color: #006699; font-weight: bold;">$name</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$email</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Message sent&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>We need to check that the sender of the message is human so we will add a simple math question to the bottom of our form.</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>
&nbsp;
	<span style="color: #000088;">$num_one</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$num_two</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$final_num</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$num_one</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$num_two</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'answer'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$final_num</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$num_one</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' + '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$num_two</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' = '</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;input type=&quot;text&quot; name=&quot;answer&quot; /&gt; &lt;br /&gt;</pre></div></div>

<p>Don't forget to add</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;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>To the top of the page or we will get errors.</p>
<p>Now we check to see if they have entered information into every field and that the answer to the math question is correct, if it is the message will be sent otherwise an error will be returned.</p>
<p>All the code for the form is:</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;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;form action=&quot;send_message.php&quot; method=&quot;POST&quot;&gt;
	Name: &lt;input type=&quot;text&quot; name=&quot;name&quot;&gt; &lt;br /&gt;
	Email: &lt;input type=&quot;text&quot; name=&quot;email&quot;&gt; &lt;br /&gt;
	Message: &lt;textarea name=&quot;message&quot;&gt;&lt;/textarea&gt; &lt;br /&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
	<span style="color: #000088;">$num_one</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$num_two</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$final_num</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$num_one</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$num_two</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'answer'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$final_num</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$num_one</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' + '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$num_two</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' = '</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;input type=&quot;text&quot; name=&quot;answer&quot; /&gt; &lt;br /&gt;
	&lt;input type=&quot;submit&quot; name=&quot;send_message&quot; value=&quot;Send!&quot;&gt;
&lt;/form&gt;</pre></div></div>

<p>All the code for error checking and sending the message is:</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;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$user_answer</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'answer'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$real_answer</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'answer'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'your_address@your_email.com'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;New message from <span style="color: #006699; font-weight: bold;">$name</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span> OR <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span> OR <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Fill in all fields.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user_answer</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$real_answer</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Math question was incorrect, please try again&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$email</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Message sent&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>You can download the source code for this tutorial <a href="http://www.thetutorialblog.com/files/tutorials/contact_form.zip">here</a>.</p>
<p>Please leave your comments and suggestions below for this tutorial.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/php/php-contact-form/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP Class for Google Maps API</title>
		<link>http://www.thetutorialblog.com/php/php-class-for-google-maps-api/</link>
		<comments>http://www.thetutorialblog.com/php/php-class-for-google-maps-api/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 15:18:06 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Text Tutorials]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[geocoding]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[latitude]]></category>
		<category><![CDATA[longitude]]></category>
		<category><![CDATA[php googlemapapi]]></category>
		<category><![CDATA[text tutorial]]></category>
		<category><![CDATA[the tutorial blog]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=92</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	A few days ago I was developing a website for a client. They required that there be a map showing where addresses are that were retrieved from a database. I have never properly looked at the Google Maps API before because I have never needed to use it; so for the first time I looked [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fphp-class-for-google-maps-api%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fphp-class-for-google-maps-api%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="PHP Class for Google Maps API" alt=" PHP Class for Google Maps API" /><br />
			</a>
		</div>
<p><img class="alignleft size-full wp-image-93" title="google_maps_logo_small_blue" src="http://www.thetutorialblog.com/wp-content/uploads/2009/07/google_maps_logo_small_blue.png" alt="google maps logo small blue PHP Class for Google Maps API" width="200" height="200" />A few days ago I was developing a website for a client. They required that there be a map showing where addresses are that were retrieved from a database. I have never properly looked at the Google Maps API before because I have never needed to use it; so for the first time I looked at it and gave it a try. Then after playing around with it for a bit i realised that reverse geocoding was needed to convert the address into latitude and longitude figures.</p>
<p>Because I was programming this website in PHP I thought I would have a look around for a PHP class to see if there was a quicker way of doing this. Luckily enough I found a PHP class called <a title="PHP GoogleMapAPI" href="http://www.phpinsider.com/php/code/GoogleMapAPI/" target="_blank">PHP GoogleMapAPI</a>. It took me a few minutes to read through the documentation for this class but it was so straight forward and simple. All in all it takes only 6 lines of code using this class to create a google map and locate it to an address; because it does all the other work for you that you don't need to know about if you're not going to be programming Google Maps every day of your life.</p>
<p><span id="more-92"></span></p>
<h2>Implementing Google Maps on your website</h2>
<p>The first thing you need to do is go to <a title="PHP GoogleMapAPI" href="http://www.phpinsider.com/php/code/GoogleMapAPI/" target="_blank">the website</a> and download the class. Then copy it into the directory where you keep your classes stored on your server.</p>
<p>When you have downloaded the class, it then needs to be included in the file that we want to show the map in. At the top of your file insert the code below.</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: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'GoogleMapAPI.class.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$map</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GoogleMapAPI<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'map'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// enter YOUR Google Map Key</span>
<span style="color: #000088;">$map</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setAPIKey</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'YOURGOOGLEMAPKEY'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$map</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addMarkerByAddress</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'621 N 48th St # 6 Lincoln NE 68502'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Our Address'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&lt;b&gt;Our Address&lt;/b&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>body onload<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;onLoad()&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$map</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">printMap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;/body&gt;</pre></div></div>

<p>What we are doing here is including the class with the require function in PHP. If the class fails to be included then the rest of the page will stop executing.<br />
We then create a new instance of the class and then we insert.</p>
<p>If you have a Google Maps API key then insert it where it says 'YOURGOOGLEMAPKEY'. If you do not have one you can get one from <a href="http://code.google.com/apis/maps/signup.html" target="_blank">here</a>.</p>
<p>The function below adds a marker to the address you would like and centers it. This function takes 3 parameters; the address, a title and html.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$map</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addMarkerByAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We then need to include the onLoad function so that it knows to load the map on this page.</p>
<p>The last function that we add is</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;">$map</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">printMap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Wherever you insert this function is where the map will be displayed on the page.</p>
<h2>Let us know</h2>
<p>I hope this tutorial has been useful and you have learned something new from it. Feel free to post a comment below and share your experience with this class or the Google Maps API.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/php/php-class-for-google-maps-api/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>A Basic PHP Statistics Script</title>
		<link>http://www.thetutorialblog.com/php/a-basic-php-statistics-script/</link>
		<comments>http://www.thetutorialblog.com/php/a-basic-php-statistics-script/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 23:08:01 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[$_SERVER['REQUEST_URI'];]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array_count_values]]></category>
		<category><![CDATA[array_push]]></category>
		<category><![CDATA[explode]]></category>
		<category><![CDATA[fclose]]></category>
		<category><![CDATA[fgets]]></category>
		<category><![CDATA[fopen]]></category>
		<category><![CDATA[foreach]]></category>
		<category><![CDATA[fwrite]]></category>
		<category><![CDATA[scandir]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[substr]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=61</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	In this tutorial you will learn about writing information to a text file and then retrieving the information you wrote to the text file. Retrieving the files that are in a directory and about arrays. This is a quite basic script and there isn't much to write about it so if there is something that [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fa-basic-php-statistics-script%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fa-basic-php-statistics-script%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="A Basic PHP Statistics Script" alt=" A Basic PHP Statistics Script" /><br />
			</a>
		</div>
<p><object width="480" height="392" data="http://flash.revver.com/player/1.0/player.swf?mediaId=1525556&#038;affiliateId=42154" type="application/x-shockwave-flash" id="revvervideoa17743d6aebf486ece24053f35e1aa23"><param name="Movie" value="http://flash.revver.com/player/1.0/player.swf?mediaId=1525556&#038;affiliateId=42154"></param><param name="FlashVars" value="allowFullScreen=true&#038;backColor=#000000&#038;frontColor=#ffffff&#038;gradColor=#000000"></param><param name="AllowFullScreen" value="true"></param><param name="AllowScriptAccess" value="always"></param><embed type="application/x-shockwave-flash" src="http://flash.revver.com/player/1.0/player.swf?mediaId=1525556&#038;affiliateId=42154" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" flashvars="allowFullScreen=true&#038;backColor=#000000&#038;frontColor=#ffffff&#038;gradColor=#000000" allowfullscreen="true" width="480" height="392"></embed></object></p>
<p>In this tutorial you will learn about writing information to a text file and then retrieving the information you wrote to the text file. Retrieving the files that are in a directory and about arrays.</p>
<p>This is a quite basic script and there isn't much to write about it so if there is something that you don't understand look the function up within the PHP manual online.<br />
<span id="more-61"></span></p>
<h2>Step 1</h2>
<p>In the first step we are going to get the current page that we are at and store it within a variable. The information in that variable will then be wrote to a file called <em>stats.txt.</em></p>
<p>Include the following code in the pages that you want the number of visits to be counted for. If you have a file such as a header file than put this code in there.</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>
&nbsp;
<span style="color: #666666; font-style: italic;">// write current page to stats file</span>
<span style="color: #000088;">$cur_page</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</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;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cur_page</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$cur_page</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'index.php'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;stats.txt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;a+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cur_page</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h2>Step 2</h2>
<p>The next piece of code that we are going to write is going to retrieve the information in <em>stats.txt</em> and put it into an array. We then use the function <em>array_count_values</em> to see how many times the page url occurs. We also retrieve the files in the directory which this script is in to compare them with the files in <em>stats.txt</em>.</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>
&nbsp;
<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;stats.txt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$files</span> <span style="color: #339933;">=</span> <span style="color: #990000;">scandir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'./'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$num_files</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">feof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$line</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$line</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$line</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$num_files</span><span style="color: #339933;">,</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #000088;">$num_cv</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_count_values</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$num_files</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$num_cv</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$f</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'file: '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$f</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' - '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$c</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;br&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>If you have any other alternatives or need any help then feel free to post a comment.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/php/a-basic-php-statistics-script/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

