<?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>blarnee.com &#187; PHP</title>
	<atom:link href="http://blarnee.com/wp/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blarnee.com/wp</link>
	<description>Web design and development online &#124; Adnan Osmani's blog</description>
	<lastBuildDate>Fri, 03 Sep 2010 18:35:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How To Create A Simple Pagination System Using jQuery, PHP and mySQL</title>
		<link>http://blarnee.com/wp/how-to-create-a-simple-pagination-system-using-jquery-php-and-mysql/</link>
		<comments>http://blarnee.com/wp/how-to-create-a-simple-pagination-system-using-jquery-php-and-mysql/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 03:13:26 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[pagination with javascript]]></category>
		<category><![CDATA[pagination with jquery]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://addyosmani.com/blog/?p=83</guid>
		<description><![CDATA[Have you ever needed to paginate your data (blog posts, links, images or anything else) using jQuery but were a little unsure of just how to achieve the effect? In this post, I&#8217;m going to show you just how easy it can be. Let&#8217;s decide on a good example to demonstrate pagination. How about a [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/how-to-create-animated-skype-style-buttons-using-jquery/' rel='bookmark' title='Permanent Link: How to create animated Skype-style buttons using jQuery'>How to create animated Skype-style buttons using jQuery</a> <small>&nbsp;Hey guys. If you&#8217;re a frequent user of Skype I&#8217;m...</small></li><li><a href='http://blarnee.com/wp/how-to-add-custom-missing-image-holders-using-jquery/' rel='bookmark' title='Permanent Link: How to add custom missing image holders using jQuery'>How to add custom missing image holders using jQuery</a> <small>We&#8217;ve all experienced the dreaded &quot;red cross in a box&quot;...</small></li><li><a href='http://blarnee.com/wp/jquery-colour-selector-plug-in-with-support-for-graceful-degradation/' rel='bookmark' title='Permanent Link: jQuery Colour Selector plug-in with support for graceful degradation'>jQuery Colour Selector plug-in with support for graceful degradation</a> <small> Hey guys. Here&#8217;s another entry on jQuery that someone...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img width="350" height="150" src="http://addyosmani.com/blog/wp-content/uploads/pagination.jpg" alt="" /></p>
<p><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2">Have you ever needed to paginate your data (blog posts, links, images or anything else) using jQuery but were a little unsure of just how to achieve the effect? In this post, I&#8217;m going to show you just how easy it can be.</span></span> <span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2">Let&#8217;s decide on a good example to demonstrate pagination. How about a simple commenting system?. Awesome..now lets begin.</span></span></p>
<p><span id="more-549"></span></p>
<p>&nbsp;</p>
<p><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2">First, lets create a new database table to store each comment&#8217;s ID and comment text. </span></span></p>
<p><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2"><b zid="3"><br zid="375" /><br />
The SQL</b><br zid="4" /></p>
<div style="border: 2px dashed rgb(222, 222, 222); padding: 10px; font-family: 'Courier New',Courier,monospace; font-size: 13px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); line-height: 16px;" class="code" zid="5">CREATE TABLE<span class="Apple-converted-space" zid="6"> </span><b style="color: blue;" zid="7">comments</b><br zid="8" /><br />
(<br zid="9" /><br />
<span style="color: rgb(204, 0, 0);" zid="10">cmt_id</span><span class="Apple-converted-space" zid="11">&nbsp;</span>INT<span class="Apple-converted-space" zid="12">&nbsp;</span><span style="color: blue;" zid="13">PRIMARY KEY</span><span class="Apple-converted-space" zid="14">&nbsp;</span><span style="color: rgb(166, 77, 121);" zid="15">AUTO_INCREMENT</span>,<br zid="16" /><br />
<span style="color: rgb(204, 0, 0);" zid="17">comment</span><span class="Apple-converted-space" zid="18"> </span>TEXT<br zid="19" /><br />
);</div>
<p><br zid="20" /><br />
</span></span><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2">Next, we use some jQuery to load up the pagination. This can switch between pages depending on what page number is being requested by your UI.<br />
</span></span></p>
<p><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2"><b zid="21">jQuery &gt;&gt;pagination.js</b><br zid="22" /><br />
The jQuery that controls the pagination controls<br zid="23" /></p>
<div style="border: 2px dashed rgb(222, 222, 222); padding: 10px; font-family: 'Courier New',Courier,monospace; font-size: 13px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); line-height: 16px;" class="code" zid="24">$(<b zid="25"><span style="color: rgb(166, 77, 121);" zid="26">document</span></b>).ready(<b zid="27">function</b>()<br zid="28" /><br />
{<br zid="29" /></p>
<div style="color: orange; margin-left: 40px;" zid="30">//Display Loading Image</div>
<div style="margin-left: 40px;" zid="365"><b zid="31">function</b><span style="color: rgb(204, 0, 0);" zid="32"><span class="Apple-converted-space" zid="33">&nbsp;</span>Display_Load</span>()<br zid="34" /><br />
{<br zid="35" /><br />
$(<span style="color: blue;" zid="36">&quot;#loading&quot;</span>).<b zid="37"><span style="color: rgb(166, 77, 121);" zid="38">fadeIn</span></b>(<span style="color: rgb(204, 0, 0);" zid="39">900</span>,<span style="color: rgb(204, 0, 0);" zid="40">0</span>);<br zid="41" /><br />
$(<span style="color: blue;" zid="42">&quot;#loading&quot;</span>).<b style="color: rgb(166, 77, 121);" zid="43">html</b>(<span style="color: blue;" zid="44">&quot;&lt;img src=&quot;loadAnm.gif&quot; /&gt;&quot;</span>);<br zid="45" /><br />
}</div>
<div style="color: orange; margin-left: 40px;" zid="47">//Hide Loading Image</div>
<div style="margin-left: 40px;" zid="366"><b zid="48">function</b><span class="Apple-converted-space" zid="49">&nbsp;</span><span style="color: rgb(204, 0, 0);" zid="50">Hide_Load</span>()<br zid="51" /><br />
{<br zid="52" /><br />
$(<span style="color: blue;" zid="53">&quot;#loading&quot;</span>).<b style="color: rgb(166, 77, 121);" zid="54">fadeOut</b>(<span style="color: blue;" zid="55">&#8216;slow&#8217;</span>);<br zid="56" /><br />
};</div>
<p><br zid="58" /></p>
<div style="color: orange; margin-left: 40px;" zid="59">//Default Starting Page Results</div>
<div style="margin-left: 40px;" zid="367">$(<span style="color: blue;" zid="60">&quot;#pagination li:first&quot;</span>)<br zid="61" /><br />
.<b style="color: rgb(166, 77, 121);" zid="62">css</b>({<span style="color: blue;" zid="63">&#8216;color&#8217;<span class="Apple-converted-space" zid="64">&nbsp;</span></span>:<span class="Apple-converted-space" zid="65">&nbsp;</span><span style="color: blue;" zid="66">&#8216;#FF0084&#8242;</span>}).<b style="color: rgb(166, 77, 121);" zid="67">css</b>({<span style="color: blue;" zid="68">&#8216;border&#8217;</span><span class="Apple-converted-space" zid="69">&nbsp;</span>:<span class="Apple-converted-space" zid="70">&nbsp;</span><span style="color: blue;" zid="71">&#8216;none&#8217;</span>});<br zid="72" /><br />
<span style="color: rgb(204, 0, 0);" zid="73">Display_Load</span>();<br zid="74" /><br />
$(<span style="color: blue;" zid="75">&quot;#content&quot;</span>).<b style="color: rgb(166, 77, 121);" zid="76">load</b>(<span style="color: blue;" zid="77">&quot;pagination_data.php?page=1&quot;</span>,<span class="Apple-converted-space" zid="78">&nbsp;</span><span style="color: rgb(204, 0, 0);" zid="79">Hide_Load</span>());</div>
<div style="color: orange; margin-left: 40px;" zid="82">//Pagination Click</div>
<div style="margin-left: 40px;" zid="368">$(<span style="color: blue;" zid="83">&quot;#pagination li&quot;</span>).<b style="color: rgb(166, 77, 121);" zid="84">click</b>(<b zid="85">function</b>(){<br zid="86" /><br />
<span style="color: rgb(204, 0, 0);" zid="87">Display_Load</span>();</div>
<div style="color: orange; margin-left: 40px;" zid="89">//CSS Styles</div>
<div style="margin-left: 40px;" zid="369">$(<span style="color: blue;" zid="90">&quot;#pagination li&quot;</span>)<br zid="91" /><br />
.<b style="color: rgb(166, 77, 121);" zid="92">css</b>({<span style="color: blue;" zid="93">&#8216;border&#8217;<span class="Apple-converted-space" zid="94">&nbsp;</span></span>:<span style="color: blue;" zid="95"><span class="Apple-converted-space" zid="96">&nbsp;</span>&#8216;solid #dddddd 1px&#8217;</span>})<br zid="97" /><br />
.<b style="color: rgb(166, 77, 121);" zid="98">css</b>({<span style="color: blue;" zid="99">&#8216;color&#8217;</span><span class="Apple-converted-space" zid="100">&nbsp;</span>:<span class="Apple-converted-space" zid="101">&nbsp;</span><span style="color: blue;" zid="102">&#8216;#0063DC&#8217;</span>});<br zid="103" /><br />
<br zid="104" /><br />
$(<b style="color: rgb(7, 55, 99);" zid="105">this</b>)<br zid="106" /><br />
.<b style="color: rgb(166, 77, 121);" zid="107">css</b>({<span style="color: blue;" zid="108">&#8216;color&#8217;<span class="Apple-converted-space" zid="109">&nbsp;</span></span>:<span style="color: blue;" zid="110"><span class="Apple-converted-space" zid="111">&nbsp;</span>&#8216;#FF0084&#8242;</span>})<br zid="112" /><br />
.<b style="color: rgb(166, 77, 121);" zid="113">css</b>({<span style="color: blue;" zid="114">&#8216;border&#8217;</span><span class="Apple-converted-space" zid="115">&nbsp;</span>:<span class="Apple-converted-space" zid="116">&nbsp;</span><span style="color: blue;" zid="117">&#8216;none&#8217;</span>});</div>
<div style="color: orange; margin-left: 40px;" zid="120">//Loading Data</div>
<div style="margin-left: 40px;" zid="370"><b style="color: rgb(7, 55, 99);" zid="121">var</b><span class="Apple-converted-space" zid="122">&nbsp;</span>pageNum =<span style="color: rgb(7, 55, 99);" zid="123"><span class="Apple-converted-space" zid="124">&nbsp;</span></span><b style="color: rgb(7, 55, 99);" zid="125">this</b>.id;<br zid="126" /><br />
$(<span style="color: blue;" zid="127">&quot;#content&quot;</span>).<b zid="128"><span style="color: rgb(166, 77, 121);" zid="129">load</span></b>(<span style="color: blue;" zid="130">&quot;pagination_data.php?page=&quot;<span class="Apple-converted-space" zid="131">&nbsp;</span></span>+ pageNum,<span style="color: rgb(204, 0, 0);" zid="132">Hide_Load</span>());<br zid="133" /><br />
});</div>
<p><br zid="135" /><br />
});</div>
<p><br zid="136" /><br />
</span></span><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2">We&#8217;re also going to need to use some PHP for all our server-side comms. Lets setup a simple configuration file to allow us to connect up to the mySQL database we&#8217;re using to store our comments.</span></span></p>
<p><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2"><b zid="137">PHP &gt;&gt; config.php</b><br zid="138" /><br />
Adjust the usual hostname, user, password and database for the data source configuration.<br zid="139" /></p>
<div style="border: 2px dashed rgb(222, 222, 222); padding: 10px; font-family: 'Courier New',Courier,monospace; font-size: 13px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); line-height: 16px;" class="code" zid="140">
<div style="color: rgb(204, 0, 0);" zid="141"><b zid="142">&lt;?php</b></div>
<p>$mysql_hostname =<span class="Apple-converted-space" zid="143">&nbsp;</span><span style="color: rgb(204, 0, 0);" zid="144">&quot;localhost&quot;</span>;<br zid="145" /><br />
$mysql_user =<span class="Apple-converted-space" zid="146">&nbsp;</span><span style="color: rgb(204, 0, 0);" zid="147">&quot;username&quot;</span>;<br zid="148" /><br />
$mysql_password =<span class="Apple-converted-space" zid="149">&nbsp;</span><span style="color: rgb(204, 0, 0);" zid="150">&quot;password&quot;</span>;<br zid="151" /><br />
$mysql_database =<span class="Apple-converted-space" zid="152">&nbsp;</span><span style="color: rgb(204, 0, 0);" zid="153">&quot;database&quot;</span>;<br zid="154" /><br />
$bd =<span class="Apple-converted-space" zid="155">&nbsp;</span><span style="color: blue;" zid="156">mysql_connect</span>($mysql_hostname, $mysql_user, $mysql_password)<span class="Apple-converted-space" zid="157">&nbsp;</span><br zid="158" /><br />
or<span class="Apple-converted-space" zid="159">&nbsp;</span><span style="color: blue;" zid="160">die</span>(<span style="color: rgb(204, 0, 0);" zid="161">&quot;Opps some thing went wrong&quot;</span>);<br zid="162" /><br />
<span style="color: blue;" zid="163">mysql_select_db</span>($mysql_database, $bd)<span class="Apple-converted-space" zid="164">&nbsp;</span><br zid="165" /><br />
or<span class="Apple-converted-space" zid="166">&nbsp;</span><span style="color: blue;" zid="167">die</span>(<span style="color: rgb(204, 0, 0);" zid="168">&quot;Opps some thing went wrong&quot;</span>);<br zid="169" /></p>
<div style="color: rgb(204, 0, 0);" zid="170"><b zid="171">?&gt;</b></div>
</div>
<p><br zid="172" /><br />
</span></span><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2">Lets calculate the number of pages needed from our comments. You can define as many items per page here as you would like.</span></span></p>
<p><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2"><b zid="173">PHP &gt;&gt; pagination.php</b><br zid="175" /></p>
<div style="border: 2px dashed rgb(222, 222, 222); padding: 10px; font-family: 'Courier New',Courier,monospace; font-size: 13px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); line-height: 16px;" class="code" zid="176">
<div style="color: rgb(204, 0, 0);" zid="177"><b zid="178">&lt;?php</b></div>
<p><span style="color: rgb(56, 118, 29);" zid="179">include</span>(<span style="color: rgb(204, 0, 0);" zid="180">&#8216;config.php&#8217;</span>);<br zid="181" /><br />
$per_page =<span class="Apple-converted-space" zid="182"> </span><span style="color: rgb(204, 0, 0);" zid="183">10</span>;<span class="Apple-converted-space" zid="184">&nbsp;</span><br zid="185" /><br />
<br zid="186" /><br />
<span style="color: orange;" zid="187">//Calculating no of pages</span><br zid="188" /><br />
$sql =<span class="Apple-converted-space" zid="189">&nbsp;</span><span style="color: orange;" zid="190">&quot;select * from comments&quot;</span>;<br zid="191" /><br />
$result =<span class="Apple-converted-space" zid="192">&nbsp;</span><span style="color: blue;" zid="193">mysql_query</span>($sql);<br zid="194" /><br />
$count =<span class="Apple-converted-space" zid="195">&nbsp;</span><span style="color: blue;" zid="196">mysql_num_rows</span>($result);<br zid="197" /><br />
$pages =<span style="color: blue;" zid="198"><span class="Apple-converted-space" zid="199">&nbsp;</span>ceil</span>($count/$per_page)<br zid="200" /></p>
<div style="color: rgb(204, 0, 0);" zid="201"><b zid="202">?&gt;</b></div>
<p><br zid="203" /><br />
<span style="color: rgb(153, 0, 0);" zid="204">&lt;script</span><span class="Apple-converted-space" zid="205">&nbsp;</span>type=&quot;<span style="color: rgb(11, 83, 148);" zid="206">text/javascript</span>&quot; src=&quot;<span style="color: rgb(11, 83, 148);" zid="207">http://ajax.googleapis.com/ajax/<br zid="208" /><br />
libs/jquery/1.3.0/jquery.min.js</span>&quot;<span style="color: rgb(153, 0, 0);" zid="209">&gt;</span><span style="color: rgb(153, 0, 0);" zid="210">&lt;/script&gt;</span><br zid="211" /><br />
<span style="color: rgb(153, 0, 0);" zid="212">&lt;script</span><span class="Apple-converted-space" zid="213">&nbsp;</span>type=&quot;<span style="color: rgb(11, 83, 148);" zid="214">text/javascript</span>&quot; src=&quot;<span style="color: rgb(11, 83, 148);" zid="215">pagination.js</span>&quot;<span style="color: rgb(153, 0, 0);" zid="216">&gt;</span><span style="color: rgb(153, 0, 0);" zid="217">&lt;/script&gt;</span><br zid="218" /><br />
<br zid="219" /></p>
<div style="color: rgb(7, 55, 99);" zid="220"><b zid="221">&lt;div id=&quot;</b><span style="color: blue;" zid="222">loading</span><b zid="223">&quot; &gt;&lt;/div&gt;</b></div>
<div style="color: rgb(7, 55, 99);" zid="224"><b zid="225">&lt;div id=&quot;</b><span style="color: blue;" zid="226">content</span><b zid="227">&quot; &gt;&lt;/div&gt;</b></div>
<div style="color: rgb(166, 77, 121);" zid="228"><b zid="229">&lt;ul id=&quot;<span style="color: blue;" zid="230">pagination</span>&quot;&gt;</b></div>
<div style="color: rgb(204, 0, 0);" zid="231"><b zid="232">&lt;?php</b></div>
<div style="color: orange;" zid="233">//Pagination Numbers</div>
<p><span style="color: rgb(56, 118, 29);" zid="234">for</span>($i<span style="color: blue;" zid="235">=</span><span style="color: rgb(204, 0, 0);" zid="236">1</span>; $i<span style="color: blue;" zid="237">&lt;=</span>$pages; $i<span style="color: blue;" zid="238">++</span>)<br zid="239" /><br />
{<br zid="240" /><br />
<span style="color: blue;" zid="241">echo</span><span style="color: rgb(204, 0, 0);" zid="242"><span class="Apple-converted-space" zid="243">&nbsp;</span>&#8216;&lt;li id=&quot;&#8217;</span><b zid="244"><span style="color: blue;" zid="245">.</span></b>$i<b style="color: blue;" zid="246">.</b><span style="color: rgb(204, 0, 0);" zid="247">&#8216;&quot;&gt;&#8217;</span><b style="color: blue;" zid="248">.</b>$i<b style="color: blue;" zid="249">.</b><span style="color: rgb(204, 0, 0);" zid="250">&#8216;&lt;/li&gt;&#8217;</span>;<br zid="251" /><br />
}<br zid="252" /></p>
<div style="color: rgb(204, 0, 0);" zid="253"><b zid="254">?&gt;</b></div>
<div style="color: rgb(166, 77, 121);" zid="255"><b zid="256">&lt;/ul&gt;</b></div>
</div>
<p><br zid="257" /><br />
</span></span><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2">And finally, here&#8217;s the mySQL and PHP to handle our complete set of pagination queries.</span></span></p>
<p><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" class="Apple-style-span" zid="1"><span style="font-family: Gotham-Light,GothamLight,Gotham,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 15px; line-height: 24px;" class="Apple-style-span" zid="2"><b zid="258">PHP &gt;&gt; pagination_data.php</b><br zid="259" /><br />
A PHP Script that will display content from the database<br zid="260" /></p>
<div style="border: 2px dashed rgb(222, 222, 222); padding: 10px; font-family: 'Courier New',Courier,monospace; font-size: 13px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); line-height: 16px;" class="code" zid="261">
<div style="color: rgb(204, 0, 0);" zid="262"><b zid="263">&lt;?php</b></div>
<p><span style="color: rgb(56, 118, 29);" zid="264">include</span>(<span style="color: rgb(204, 0, 0);" zid="265">&#8216;config.php&#8217;</span>);<br zid="266" /><br />
$per_page =<span class="Apple-converted-space" zid="267">&nbsp;</span><span style="color: rgb(204, 0, 0);" zid="268">9</span>;<span class="Apple-converted-space" zid="269">&nbsp;</span><br zid="270" /><br />
if(<span style="color: rgb(11, 83, 148);" zid="271">$_GET</span>)<br zid="272" /><br />
{<br zid="273" /><br />
$page=<span style="color: rgb(11, 83, 148);" zid="274">$_GET</span>[<span style="color: rgb(204, 0, 0);" zid="275">'page'</span>];<br zid="276" /><br />
}<br zid="277" /><br />
<br zid="278" /><br />
$start = ($page-<span style="color: rgb(204, 0, 0);" zid="279">1</span>)<span style="color: blue;" class="Apple-style-span" zid="280">*</span>$per_page;<br zid="281" /><br />
$sql =<span style="color: rgb(204, 0, 0);" zid="282"><span class="Apple-converted-space" zid="283">&nbsp;</span>&quot;select * from comments order by cmt_id limit $start,$per_page&quot;</span>;<br zid="284" /><br />
$result =<span class="Apple-converted-space" zid="285">&nbsp;</span><span style="color: blue;" zid="286">mysql_query</span>($sql);<br zid="287" /></p>
<div style="color: rgb(204, 0, 0);" zid="288"><b zid="289">?&gt;<br zid="371" /><br />
<br zid="372" /><br />
<br zid="373" /><br />
</b></div>
<p>&lt;table width=&quot;800px&quot;&gt;<br zid="290" /></p>
<div style="color: rgb(204, 0, 0);" zid="291"><b zid="292">&lt;?</b></div>
<p>while($row =<span class="Apple-converted-space" zid="293">&nbsp;</span><span style="color: blue;" zid="294">mysql_fetch_array</span>($result))<br zid="295" /><br />
{<br zid="296" /><br />
$cmt_id=$row[<span style="color: rgb(204, 0, 0);" zid="297">'cmt_id'</span>];<br zid="298" /><br />
$comment=$row[<span style="color: rgb(204, 0, 0);" zid="299">'comment'</span>];<br zid="300" /></p>
<div style="color: rgb(204, 0, 0);" zid="301"><b zid="302">?&gt;</b></div>
<p>&lt;tr&gt;<br zid="303" /><br />
&lt;td&gt;<b zid="304"><span style="color: rgb(204, 0, 0);" zid="305">&lt;?php</span></b><span class="Apple-converted-space" zid="306">&nbsp;</span><span style="color: blue;" zid="307">echo</span><span class="Apple-converted-space" zid="308">&nbsp;</span>$cmt_id;<span class="Apple-converted-space" zid="309">&nbsp;</span><b zid="310"><span style="color: rgb(204, 0, 0);" zid="311">?&gt;</span></b>&lt;/td&gt;<br zid="312" /><br />
&lt;td&gt;<b style="color: rgb(204, 0, 0);" zid="313">&lt;?php</b><span class="Apple-converted-space" zid="314">&nbsp;</span><span style="color: blue;" zid="315">echo</span><span class="Apple-converted-space" zid="316">&nbsp;</span>$comment;<span class="Apple-converted-space" zid="317">&nbsp;</span><b zid="318"><span style="color: rgb(204, 0, 0);" zid="319">?&gt;</span></b>&lt;/td&gt;<br zid="320" /><br />
&lt;/tr&gt;<br zid="321" /></p>
<div style="color: rgb(204, 0, 0);" zid="322"><b zid="323">&lt;?</b></div>
<p>}<br zid="324" /></p>
<div style="color: rgb(204, 0, 0);" zid="325"><b zid="326">?&gt;</b></div>
<p>&lt;/table&gt;</p></div>
<p><br zid="327" /><br />
<b zid="328">CSS Code</b><br zid="329" /><br />
CSS stylesheet for the page<br zid="330" /></p>
<div style="border: 2px dashed rgb(222, 222, 222); padding: 10px; font-family: 'Courier New',Courier,monospace; font-size: 13px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); line-height: 16px;" class="code" zid="331">
<div style="color: rgb(166, 77, 121);" zid="332"><b zid="333">/*Pagination Stylesheet*/<br zid="374" /><br />
#loading</b></div>
<p>{<span class="Apple-converted-space" zid="334">&nbsp;</span><br zid="335" /><br />
width: 100%;<span class="Apple-converted-space" zid="336">&nbsp;</span><br zid="337" /><br />
position: absolute;<br zid="338" /><br />
}<br zid="339" /></p>
<div style="color: rgb(166, 77, 121);" zid="340"><b zid="341">li</b></div>
<p>{<span class="Apple-converted-space" zid="342">&nbsp;</span><br zid="343" /><br />
list-style: none;<span class="Apple-converted-space" zid="344">&nbsp;</span><br zid="345" /><br />
float: left;<span class="Apple-converted-space" zid="346">&nbsp;</span><br zid="347" /><br />
margin-right: 16px;<span class="Apple-converted-space" zid="348">&nbsp;</span><br zid="349" /><br />
padding:5px;<span class="Apple-converted-space" zid="350">&nbsp;</span><br zid="351" /><br />
border:solid 1px #dddddd;<br zid="352" /><br />
color:#0063DC;<span class="Apple-converted-space" zid="353">&nbsp;</span><br zid="354" /><br />
}<br zid="355" /></p>
<div style="color: rgb(166, 77, 121);" zid="356"><b zid="357">li:hover</b></div>
<p>{<span class="Apple-converted-space" zid="358">&nbsp;</span><br zid="359" /><br />
color:#FF0084;<span class="Apple-converted-space" zid="360">&nbsp;</span><br zid="361" /><br />
cursor: pointer;<span class="Apple-converted-space" zid="362">&nbsp;</span><br zid="363" /><br />
}</div>
<p></span></span></p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2Fhow-to-create-a-simple-pagination-system-using-jquery-php-and-mysql%2F&amp;t=How%20To%20Create%20A%20Simple%20Pagination%20System%20Using%20jQuery%2C%20PHP%20and%20mySQL" id="facebook_share_button_549" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_549') || document.getElementById('facebook_share_icon_549') || document.getElementById('facebook_share_both_549') || document.getElementById('facebook_share_button_549');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_549') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/how-to-create-animated-skype-style-buttons-using-jquery/' rel='bookmark' title='Permanent Link: How to create animated Skype-style buttons using jQuery'>How to create animated Skype-style buttons using jQuery</a> <small>&nbsp;Hey guys. If you&#8217;re a frequent user of Skype I&#8217;m...</small></li><li><a href='http://blarnee.com/wp/how-to-add-custom-missing-image-holders-using-jquery/' rel='bookmark' title='Permanent Link: How to add custom missing image holders using jQuery'>How to add custom missing image holders using jQuery</a> <small>We&#8217;ve all experienced the dreaded &quot;red cross in a box&quot;...</small></li><li><a href='http://blarnee.com/wp/jquery-colour-selector-plug-in-with-support-for-graceful-degradation/' rel='bookmark' title='Permanent Link: jQuery Colour Selector plug-in with support for graceful degradation'>jQuery Colour Selector plug-in with support for graceful degradation</a> <small> Hey guys. Here&#8217;s another entry on jQuery that someone...</small></li></ol></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://blarnee.com/wp/how-to-create-a-simple-pagination-system-using-jquery-php-and-mysql/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>10 Incredibly Professional Tips for Web Designers and Web Developers</title>
		<link>http://blarnee.com/wp/10-incredibly-professional-tips-for-web-designers-and-web-developers/</link>
		<comments>http://blarnee.com/wp/10-incredibly-professional-tips-for-web-designers-and-web-developers/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 04:34:28 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[be better]]></category>
		<category><![CDATA[career]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[how to create]]></category>
		<category><![CDATA[improve]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[professional]]></category>
		<category><![CDATA[skills]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[web developers]]></category>

		<guid isPermaLink="false">http://addyosmani.com/blog/10-incredibly-professional-tips-for-web-designers-and-web-developers/</guid>
		<description><![CDATA[&#160; Professional development is one of the key elements to improving your skills as a designer or developer. In this article I&#8217;m going to provide you some of the popular tips I&#8217;ve previously shared on Behance, Scribd, DeviantArt and my own blog, that&#8217;ll help you be the best. If you would like to download or [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/10-tips-for-web-designers-and-web-developers/' rel='bookmark' title='Permanent Link: 10 Tips for Web Designers and Web Developers'>10 Tips for Web Designers and Web Developers</a> <small> I recently came across some interesting discussions on what...</small></li><li><a href='http://blarnee.com/wp/7-really-useful-tips-for-better-jquery-code/' rel='bookmark' title='Permanent Link: 7 Really Useful Tips For Better jQuery Code'>7 Really Useful Tips For Better jQuery Code</a> <small>&nbsp; I&rsquo;ve been using jQuery in my web apps for...</small></li><li><a href='http://blarnee.com/wp/how-to-develop-a-web-application-in-5-easy-steps-a-guide-for-web-developers-and-businesses/' rel='bookmark' title='Permanent Link: How to develop a Web Application in 5 easy steps &#8211; A guide for web developers and businesses'>How to develop a Web Application in 5 easy steps &#8211; A guide for web developers and businesses</a> <small> Having developed web applications for a few years now,...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p><a href="http://blarnee.com/wp/wp-content/uploads/imageaxd.png" class="thickbox"><img title="image.axd" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px 15px 0px 0px; border-left: 0px; border-bottom: 0px" height="199" alt="image.axd" src="http://blarnee.com/wp/wp-content/uploads/imageaxd_thumb.png" width="244" align="left" border="0" /></a> </p>
<p>Professional development is one of the <strong>key</strong> elements to improving your skills as a designer or developer. In this article I&#8217;m going to provide you some of the popular tips I&#8217;ve previously shared on Behance, Scribd, DeviantArt and my own blog, that&#8217;ll help you be the best. If you would like to download or print the article, you can get the 1-page PDF <a href="http://addyosmani.googlepages.com/professional.pdf">here</a> or favourite it on Scribd <a href="http://www.scribd.com/doc/17584120/10-Tips-for-Web-designers-and-developers">here</a>.</p>
<p> <span id="more-49"></span>
<p>&#160;</p>
<p>1.<b>Enjoy your job.</b> If you don&#8217;t love doing what you do, whether that be designing software or building web sites and understanding the web, try something else. Life is to short to waste doing something you don&#8217;t have a passion for.</p>
<p>&#160;</p>
<p>2.<b>Know HTML, CSS and JavaScript back to front </b>- Clients and companies don&#8217;t care if you are a developer, designer, information architect or anything else you need to know the core technologies that underpin the web back to front. Everything is ultimately built on these three</p>
<p>&#160;</p>
<p>3.<b>Develop with the latest best practices in mind</b> &#8211; Ensure you separate content, design and behaviour. Make sure everything you build uses progressive enhancement.</p>
<p>&#160;</p>
<p>4.<b>Learn as much as you can, and plan on keeping that up for the rest of your professional life. </b>Subscribe to a few key RSS feeds (eg. Smashing Magazine) &#8211; this is the easiest way to keep up to date with developments in the industry and will help your knowledge grow each day.</p>
<p>&#160;</p>
<p>5.<b>When you just can&#8217;t wait to get started, don&#8217;t forget about the first step &#8211; planning.</b> Whether you need to draw wireframes or just some scribbles on a piece of paper, you can save yourself countless hours by reviewing your design before you go coding it up. This can also make explaining it a lot easier than wildly waving your hands in the air.</p>
<p>&#160;</p>
<p>6.<b>Set yourself development goals</b>. Don&#8217;t stagnate just because you have learnt some jQuery. Look into technologies and ways of advancing your skills.</p>
<p>&#160;</p>
<p>7.<b>Make sure you make websites degrade gracefully.</b> Perfect example is using JS for certain portions of a website. Code it, then turn off JS and make sure it&#8217;s still functional.</p>
<p>&#160;</p>
<p>8.<b>Realize that there will always be someone who knows more about a subject than you do</b>. This can be hard to admit when you&#8217;ve been coding software or developing websites for many years, but it&#8217;s true of any industry. If someone comes up with an alternative way of doing something, at least take a look at it &#8211; you never know, it might be better than yours.</p>
<p>&#160;</p>
<p>9. <b>Feel free to try out new ideas or explore side-projects in your spare time.</b> This could be a blog, a journal or something more substantial like a coding project. Whatever it is, you owe yourself the freedom to use your skills to do something that you enjoy.</p>
<p>&#160;</p>
<p>10. <b>Remember to get feedback at all stages of a project. </b>There is nothing a client hates more than uncertainty and if you can give them a good level of reassurance that their project is in good hands and progress is being made, you&#8217;ll find there&#8217;s a lot more room for understanding in case something takes longer to do than expected.</p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2F10-incredibly-professional-tips-for-web-designers-and-web-developers%2F&amp;t=10%20Incredibly%20Professional%20Tips%20for%20Web%20Designers%20and%20Web%20Developers" id="facebook_share_button_49" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_49') || document.getElementById('facebook_share_icon_49') || document.getElementById('facebook_share_both_49') || document.getElementById('facebook_share_button_49');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_49') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/10-tips-for-web-designers-and-web-developers/' rel='bookmark' title='Permanent Link: 10 Tips for Web Designers and Web Developers'>10 Tips for Web Designers and Web Developers</a> <small> I recently came across some interesting discussions on what...</small></li><li><a href='http://blarnee.com/wp/7-really-useful-tips-for-better-jquery-code/' rel='bookmark' title='Permanent Link: 7 Really Useful Tips For Better jQuery Code'>7 Really Useful Tips For Better jQuery Code</a> <small>&nbsp; I&rsquo;ve been using jQuery in my web apps for...</small></li><li><a href='http://blarnee.com/wp/how-to-develop-a-web-application-in-5-easy-steps-a-guide-for-web-developers-and-businesses/' rel='bookmark' title='Permanent Link: How to develop a Web Application in 5 easy steps &#8211; A guide for web developers and businesses'>How to develop a Web Application in 5 easy steps &#8211; A guide for web developers and businesses</a> <small> Having developed web applications for a few years now,...</small></li></ol></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://blarnee.com/wp/10-incredibly-professional-tips-for-web-designers-and-web-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>September&#039;s Book Recommendations for the JavaScript Ninja or PHP Guru</title>
		<link>http://blarnee.com/wp/septembers-book-recommendations-for-the-javascript-ninja-or-php-guru/</link>
		<comments>http://blarnee.com/wp/septembers-book-recommendations-for-the-javascript-ninja-or-php-guru/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 04:26:21 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[book recommendations]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[books to read]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[john resig]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php mashups]]></category>

		<guid isPermaLink="false">http://addyosmani.com/blog/septembers-book-recommendations-for-the-javascript-ninja-or-php-guru/</guid>
		<description><![CDATA[Thanks to Amazon Associates, this month I have a new widget to display my book recommendations in..and boy have I got some good books for you guys to check out. The first (and a title I&#8217;ve been looking forward to for quite some time) is John Resig&#8217;s Secrets of the JavaScript Ninja. For anyone unfamiliar [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/the-secrets-of-4-javascript-libraries/' rel='bookmark' title='Permanent Link: The secrets of 4 JavaScript Libraries'>The secrets of 4 JavaScript Libraries</a> <small>Here&#8217;s a quick lunchtime post that&#8217;ll show you some of...</small></li><li><a href='http://blarnee.com/wp/how-to-create-impressive-animations-in-jquery-with-animate/' rel='bookmark' title='Permanent Link: How to create impressive animations in jQuery with .animate()'>How to create impressive animations in jQuery with .animate()</a> <small> I&#8217;ve been asked many times over the past month...</small></li><li><a href='http://blarnee.com/wp/web-workers-parallel-javascript-tasking-for-the-masses/' rel='bookmark' title='Permanent Link: Web Workers &#8211; parallel JavaScript tasking for the masses'>Web Workers &#8211; parallel JavaScript tasking for the masses</a> <small>&nbsp; I&#8217;ve been looking at some of the cool new...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Thanks to <b>Amazon Associates</b>, this month I have a new widget to display my book recommendations in..and boy have I got some good books for you guys to check out.</p>
<p>The first (and a title I&#8217;ve been looking forward to for quite some time) is John Resig&#8217;s <b>Secrets of the JavaScript Ninja</b>. For anyone unfamiliar with the author, Resig is the author of that great framework many of us use everyday &#8211; jQuery. In this, his second book, he goes into much detail about advanced uses of JavaScript, Best practices when it comes to unit testing and a whole lot more that you won&#8217;t find anywhere else. Although the book hasn&#8217;t been officially released yet, you can buy an early eBook/Paperback set from Manning Publications right now (as I did) &#8211; you won&#8217;t regret it!.</p>
<p>  Here are the others.. <span id="more-45"></span>
<p>&#160;</p>
<p>The next book I have to recommend is <b>PHP Web 2.0 Mashups</b> &#8211; I refer to this book as every Web API fans wet dream because it goes through examples of how to use many of the APIs available from popular sites like Flickr in a lot of depth. Having coded myself using many of the included services even I was surprised to learn just how much was possible by simply connecting up different APIs using a few simple lines of code. Want an example of what I&#8217;m talking about? Why not check out <a href="http://www.housingmaps.com">HousingMaps.com</a> &#8211; a PHP Mashup between Craigslist and Google Maps that lets you find houses for sale or rent across a map in any given area.</p>
<p>&#160;</p>
<p><b>Learning jQuery 1.3</b> is a good recommendation because the book is fresh off the presses, great for beginners and discusses most of latest improvements available in the framework. One of the notable improvements mentioned is the speed of CSS Style selectors &#8211; instead of using the top-down approach previously implemented, the newest version of jQuery uses a bottom-up approach called &quot;Sizzle&quot; &#8211; which allows jQuery to be much faster. Another improvement is the addition of .live() effects which allow you to add event listeners to any of the currently existing elements in your page as well as any future elements. What does this mean? Well, it means that parts of a page which you&#8217;ve updated via Ajax can also be interactively enriched without calling additional functions to re-parse the whole page. Pretty nifty, right?.</p>
<p>&#160;</p>
<p>My Final 3 recommendations for this month are: <b>Wicked-Cool PHP</b> (A great book for people who want to skip all the &quot;Hello world&quot; examples given in PHP guides for beginners and instead teaches you about GD, email notifications, Web Services and tracking your users with cookies), <b>JavaScript &#8211; The Good Parts</b> (A book aimed at developers with an intermediate level of experience that want to know the best way to create and use Objects, Types and Arrays effectively) and finally <b>Designing Web Interfaces</b> &#8211; This is a first-rate book which is filled with excellent examples from popular sites such as from Yahoo, Google, Netflix, Apple and even Xbox. Unlike most HCI books which focus on desktop applications, this book is specifically about the web and delivers on exactly what you&#8217;re after. It&#8217;s examples demonstrate just how much the web user&#8217;s interfaces have changed in the last few years and anyone designing user interfaces will find the book very useful.</p>
<p>&#160;</p>
<p>That&#8217;s it for this month&#8217;s recommendations. Let me know if you found them useful or have any recommendations of your own!</p>
<p>  <iframe border="0" height="420" src="http://folio.vndv.com/resources/amazon.html" style="border: none; overflow: hidden;" width="480"></iframe></p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2Fseptembers-book-recommendations-for-the-javascript-ninja-or-php-guru%2F&amp;t=September%26%23039%3Bs%20Book%20Recommendations%20for%20the%20JavaScript%20Ninja%20or%20PHP%20Guru" id="facebook_share_button_45" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_45') || document.getElementById('facebook_share_icon_45') || document.getElementById('facebook_share_both_45') || document.getElementById('facebook_share_button_45');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_45') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/the-secrets-of-4-javascript-libraries/' rel='bookmark' title='Permanent Link: The secrets of 4 JavaScript Libraries'>The secrets of 4 JavaScript Libraries</a> <small>Here&#8217;s a quick lunchtime post that&#8217;ll show you some of...</small></li><li><a href='http://blarnee.com/wp/how-to-create-impressive-animations-in-jquery-with-animate/' rel='bookmark' title='Permanent Link: How to create impressive animations in jQuery with .animate()'>How to create impressive animations in jQuery with .animate()</a> <small> I&#8217;ve been asked many times over the past month...</small></li><li><a href='http://blarnee.com/wp/web-workers-parallel-javascript-tasking-for-the-masses/' rel='bookmark' title='Permanent Link: Web Workers &#8211; parallel JavaScript tasking for the masses'>Web Workers &#8211; parallel JavaScript tasking for the masses</a> <small>&nbsp; I&#8217;ve been looking at some of the cool new...</small></li></ol></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://blarnee.com/wp/septembers-book-recommendations-for-the-javascript-ninja-or-php-guru/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>21 Incredibly Useful Things You Can Do With cURL and PHP</title>
		<link>http://blarnee.com/wp/21-incredibly-useful-things-you-can-do-with-curl-and-php/</link>
		<comments>http://blarnee.com/wp/21-incredibly-useful-things-you-can-do-with-curl-and-php/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 03:49:51 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[cURL php]]></category>
		<category><![CDATA[curl php examples]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php mashups]]></category>
		<category><![CDATA[recent covers last.fm]]></category>
		<category><![CDATA[shorten url bitly]]></category>
		<category><![CDATA[todolist]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Tweeting]]></category>
		<category><![CDATA[twitter API]]></category>
		<category><![CDATA[update facebook status]]></category>
		<category><![CDATA[upload files amazon]]></category>

		<guid isPermaLink="false">http://addyosmani.com/blog/21-incredibly-useful-things-you-can-do-with-curl-and-php/</guid>
		<description><![CDATA[&#160; Like me, if you’ve ever wanted to use a Web Service from a site that doesn’t have that many code examples or a solid API, chances are you may have considered using cURL – a great extension to PHP that allows you to authenticate with websites just like a normal user would. The benefits [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/15-amazing-things-you-can-do-using-curl/' rel='bookmark' title='Permanent Link: 15 amazing things you can do using cURL'>15 amazing things you can do using cURL</a> <small>If you&#8217;ve ever wanted to consume services from a popular...</small></li><li><a href='http://blarnee.com/wp/to-tweet-or-not-to-tweet-that-is-the-question/' rel='bookmark' title='Permanent Link: To tweet or not to tweet. That is the question.'>To tweet or not to tweet. That is the question.</a> <small> Lately, I&#8217;ve noticed that more and more people are...</small></li><li><a href='http://blarnee.com/wp/jquery-ui-animation-effects/' rel='bookmark' title='Permanent Link: jQuery UI Animation Effects'>jQuery UI Animation Effects</a> <small> The jQuery UI Effects Core brings a few more...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Like me, if you’ve ever wanted to use a Web Service from a site that doesn’t have that many code examples or a solid API, chances are you may have considered using <a href="http://www.php.net/curl">cURL</a> – a great extension to PHP that allows you to authenticate with websites just like a normal user would. The benefits of doing this are that you’re able to gain access to rich data sources like contact lists, email, statuses and a whole lot more. In this post I’m going to provide you with 20 code examples that’ll help you do some pretty cool things using everything from Bit.ly to Las.fm. Sites covered are Yahoo.com, Last.fm, Amazon, WordPress, Facebook, TwitPic, PayPal, Bit.ly, Twitter, GMail, MySpace, is.gd and IMDB.</p>
<p>  <span id="more-19"></span>
<p>&#160;</p>
<ol>
<li><a href="http://folio.vndv.com/scriptshare/shortenaurlwithbitly.txt">How to shorten a URL through bit.ly</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/gettrendingtopicsontwitter.txt">Get the trending topics on Twitter</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/getalbumtracks.txt">How to get the album covers of your most recent tracks on Last.fm</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/getyahoocontacts.txt">Get the list of your Yahoo Contacts via cURL</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/getyourlatesttweets.txt">How to get your very latest tweets</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/howtoupdateyourtwitter.txt">How to update your Twitter Status</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/howtouploadtofacebookvideo.txt">How to upload files to Facebook</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/importgmailcontacts.txt">How to import your GMail Contacts</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/s3php5.rar.gz">Upload files using Amazon S3 and PHP</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/logintomyspace.txt">How to login to mySpace through cURL</a> </li>
<li><a href="http://code.google.com/intl/de-DE/apis/youtube/1.0/developers_guide_php.html#UploadingVideos">How to upload videos to YouTube (API reference)</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/makeaposttowordpress.txt">How to make a post to WordPress</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/parsedetailsimdb.txt">How to parse out a movie&#8217;s details using IMDB</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/scrapebingdotcom.txt">How to Scape Bing.com for Search Results</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/updateyourfacebookstatus.txt">How to update your Facebook status</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/uploadpicturetotwitpic.txt">How to upload a picture to TwitPic through cURL</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/paypalcakephp.rar">How to process Payments using PayPal, cURL and CakePHP</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/scobblelast.txt">Scrobble tracks to your Last.fm account using cURL</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/youtubedownloader.zip">How to download videos in any format from YouTube</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/getisgdurl.txt">How to shorten a URL using the is.gd Shortening service</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/googlereader.txt">How to grab the number of subscribers from your Google Reader Account</a> </li>
</ol>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2F21-incredibly-useful-things-you-can-do-with-curl-and-php%2F&amp;t=21%20Incredibly%20Useful%20Things%20You%20Can%20Do%20With%20cURL%20and%20PHP" id="facebook_share_button_19" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_19') || document.getElementById('facebook_share_icon_19') || document.getElementById('facebook_share_both_19') || document.getElementById('facebook_share_button_19');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_19') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/15-amazing-things-you-can-do-using-curl/' rel='bookmark' title='Permanent Link: 15 amazing things you can do using cURL'>15 amazing things you can do using cURL</a> <small>If you&#8217;ve ever wanted to consume services from a popular...</small></li><li><a href='http://blarnee.com/wp/to-tweet-or-not-to-tweet-that-is-the-question/' rel='bookmark' title='Permanent Link: To tweet or not to tweet. That is the question.'>To tweet or not to tweet. That is the question.</a> <small> Lately, I&#8217;ve noticed that more and more people are...</small></li><li><a href='http://blarnee.com/wp/jquery-ui-animation-effects/' rel='bookmark' title='Permanent Link: jQuery UI Animation Effects'>jQuery UI Animation Effects</a> <small> The jQuery UI Effects Core brings a few more...</small></li></ol></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://blarnee.com/wp/21-incredibly-useful-things-you-can-do-with-curl-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>15 amazing things you can do using cURL</title>
		<link>http://blarnee.com/wp/15-amazing-things-you-can-do-using-curl/</link>
		<comments>http://blarnee.com/wp/15-amazing-things-you-can-do-using-curl/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 03:55:35 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[addressbook]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[bitly]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[cURL php]]></category>
		<category><![CDATA[cURL PHP programming]]></category>
		<category><![CDATA[download a video]]></category>
		<category><![CDATA[download youtube videos]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[grab]]></category>
		<category><![CDATA[imdb scape]]></category>
		<category><![CDATA[latest tweets]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[login to myspace]]></category>
		<category><![CDATA[make a post to wordpress]]></category>
		<category><![CDATA[myspace.com]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[post to your wordpress]]></category>
		<category><![CDATA[scrape]]></category>
		<category><![CDATA[scraping]]></category>
		<category><![CDATA[shorten a url]]></category>
		<category><![CDATA[shortena  url]]></category>
		<category><![CDATA[trending topics]]></category>
		<category><![CDATA[tweet]]></category>
		<category><![CDATA[twitpic]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[upload from twitpic]]></category>
		<category><![CDATA[upload image]]></category>
		<category><![CDATA[yahoo contacts]]></category>

		<guid isPermaLink="false">http://blarnee.com/wp/?p=513</guid>
		<description><![CDATA[If you&#8217;ve ever wanted to consume services from a popular website that doesn&#8217;t offer full code examples before, chances are you may have considered using cURL with PHP to achieve your project. cURL is amazing because it essentially allows you to simulate a user and go through any page on a site and grab some [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/21-incredibly-useful-things-you-can-do-with-curl-and-php/' rel='bookmark' title='Permanent Link: 21 Incredibly Useful Things You Can Do With cURL and PHP'>21 Incredibly Useful Things You Can Do With cURL and PHP</a> <small>&#160; Like me, if you’ve ever wanted to use a...</small></li><li><a href='http://blarnee.com/wp/an-amazing-jquery-3d-wall-for-webkit-youtube-edition/' rel='bookmark' title='Permanent Link: An Amazing jQuery 3D Wall for Webkit &#8211; YouTube Edition'>An Amazing jQuery 3D Wall for Webkit &#8211; YouTube Edition</a> <small>&#160; Hey guys. I’ve got some great new code for...</small></li><li><a href='http://blarnee.com/wp/browsing-images-by-color-and-geometric-composition/' rel='bookmark' title='Permanent Link: Browsing images by color and geometric composition'>Browsing images by color and geometric composition</a> <small>At the moment, there&#8217;s a lot of focus at Pixsta...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: small;">If you&#8217;ve ever wanted to consume services from a popular website that doesn&#8217;t offer full code examples before, chances are you may have considered using <strong>cURL</strong> with PHP to achieve your project. cURL is amazing because it essentially allows you to simulate a user and go through any page on a site and grab some information from it. It also lets you post data to the site so things like uploading an image or video are also made possible. In this post I&#8217;m going to provide you with 15 highly useful cURL scripts that you might find useful. Sites tackled in this post are: Twitter.com, Bit.ly, Facebook.com, Yahoo.com, TwitPic, mySpace.com, YouTube.com, Amazon.com, IMDB.com and Bing.com. </span><span style="font-size: x-large;"><br />
<span id="more-513"></span><br />
</span></p>
<ol>
<li><span style="font-size: x-large;"><a href="http://www.blarnee.com/resources/scripts/getyourlatesttweets.txt">Get your latest tweets from Twitter</a></span></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/shortenaurlwithbitly.txt"><span style="font-size: x-large;">Shorten a URL using Bit.ly</span></a></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/updateyourfacebookstatus.txt"><span style="font-size: x-large;">Update your Facebook Status message</span></a></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/getyahoocontacts.txt"><span style="font-size: x-large;">Grab your list of Yahoo Contacts</span></a></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/howtouploadtofacebookvideo.txt"><span style="font-size: x-large;">Upload a video to Facebook </span></a></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/uploadpicturetotwitpic.txt"><span style="font-size: x-large;">Upload a picture to TwitPic</span></a></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/logintomyspace.txt"><span style="font-size: x-large;">Login to mySpace.com</span></a><span style="font-size: x-large;"><br />
    </span></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/youtubedownloader.zip"><span style="font-size: x-large;">Download a Video from YouTube (including those needing a login)</span></a><span style="font-size: x-large;"><br />
    </span></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/makeaposttowordpress.txt"><span style="font-size: x-large;">Make a post to your WordPress blog</span></a></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/gettrendingtopicsontwitter.txt"><span style="font-size: x-large;">Get the latest trending topics on Twitter</span></a><span style="font-size: x-large;"><br />
    </span></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/s3php5.rar.gz"><span style="font-size: x-large;">Upload files to Amazon S3 through PHP</span></a></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/importgmailcontacts.txt"><span style="font-size: x-large;">Import your list of GMail contacts into PHP</span></a></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/parsedetailsimdb.txt"><span style="font-size: x-large;">Parse all the movie info from an IMDB page</span></a></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/scrapebingdotcom.txt"><span style="font-size: x-large;">Scrape the search results from Bing.com</span></a></li>
<p></p>
<li><a href="http://blarnee.com/resources/scripts/howtoupdateyourtwitter.txt"><span style="font-size: x-large;">Post a new Tweet on your Twitter account</span></a></li>
<p>
</ol>
<p><span style="font-size: x-large;"><br />
</span></p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2F15-amazing-things-you-can-do-using-curl%2F&amp;t=15%20amazing%20things%20you%20can%20do%20using%20cURL" id="facebook_share_button_513" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_513') || document.getElementById('facebook_share_icon_513') || document.getElementById('facebook_share_both_513') || document.getElementById('facebook_share_button_513');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_513') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/21-incredibly-useful-things-you-can-do-with-curl-and-php/' rel='bookmark' title='Permanent Link: 21 Incredibly Useful Things You Can Do With cURL and PHP'>21 Incredibly Useful Things You Can Do With cURL and PHP</a> <small>&#160; Like me, if you’ve ever wanted to use a...</small></li><li><a href='http://blarnee.com/wp/an-amazing-jquery-3d-wall-for-webkit-youtube-edition/' rel='bookmark' title='Permanent Link: An Amazing jQuery 3D Wall for Webkit &#8211; YouTube Edition'>An Amazing jQuery 3D Wall for Webkit &#8211; YouTube Edition</a> <small>&#160; Hey guys. I’ve got some great new code for...</small></li><li><a href='http://blarnee.com/wp/browsing-images-by-color-and-geometric-composition/' rel='bookmark' title='Permanent Link: Browsing images by color and geometric composition'>Browsing images by color and geometric composition</a> <small>At the moment, there&#8217;s a lot of focus at Pixsta...</small></li></ol></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://blarnee.com/wp/15-amazing-things-you-can-do-using-curl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to create a Facebook Friend Selector using jQuery and PHP or Grails (without FBML)</title>
		<link>http://blarnee.com/wp/how-to-create-a-facebook-friend-selector-using-jquery-and-php-or-grails-without-fbml/</link>
		<comments>http://blarnee.com/wp/how-to-create-a-facebook-friend-selector-using-jquery-and-php-or-grails-without-fbml/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 05:38:38 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[facebook api application components]]></category>
		<category><![CDATA[facebook api friend selector]]></category>
		<category><![CDATA[facebook PHP components]]></category>
		<category><![CDATA[facebook php friend selector]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[friend selection]]></category>
		<category><![CDATA[friend selector]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[grails friend selector]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP friend selector]]></category>
		<category><![CDATA[simple]]></category>

		<guid isPermaLink="false">http://blarnee.com/wp/?p=416</guid>
		<description><![CDATA[When I first attempting to code up a pure PHP Facebook app, one of the first problem&#8217;s I encountered was I wanted to create a friend selector using as little FBML or FBJS code as possible. This proved slightly difficult as any external PHP file I would create to query Facebook using FQL via Ajax [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/anatomy-of-a-facebook-application/' rel='bookmark' title='Permanent Link: Creating a Facebook Application &#8211; a simple guide for PHP, JavaScript, Flex and Grails developers.'>Creating a Facebook Application &#8211; a simple guide for PHP, JavaScript, Flex and Grails developers.</a> <small>&nbsp;If you&#8217;re a web developer and you haven&#8217;t explored the...</small></li><li><a href='http://blarnee.com/wp/creating-a-facebook-application-a-guide-for-php-javascript-flex-and-grails-developers/' rel='bookmark' title='Permanent Link: Creating a Facebook Application &#8211; a guide for PHP, JavaScript, Flex and Grails developers'>Creating a Facebook Application &#8211; a guide for PHP, JavaScript, Flex and Grails developers</a> <small> If you’re a web developer and you haven’t explored...</small></li><li><a href='http://blarnee.com/wp/how-to-create-impressive-animations-in-jquery-with-animate/' rel='bookmark' title='Permanent Link: How to create impressive animations in jQuery with .animate()'>How to create impressive animations in jQuery with .animate()</a> <small> I&#8217;ve been asked many times over the past month...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>When I first attempting to code up a pure PHP Facebook app, one of the first problem&#8217;s I encountered was I wanted to create a friend selector using as little FBML or FBJS code as possible. This proved slightly difficult as any external PHP file I would create to query Facebook using FQL via Ajax to return my friend&#8217;s array also required authentication (something that isn&#8217;t as much of a problem using Flash or Flex, but is using PHP or Grails) because it requires persistance across multiple files without having to ask the user to login to facebook again (if you&#8217;ve tried this you&#8217;ll know what I mean). Having searched online for a solution that didn&#8217;t require me to use a hacked up version of FBML..I decided to come up with a simple solution myself.</p>
<p><span id="more-416"></span></p>
<p>One way to work around this is by using JSON and the jQuery <a href="http://docs.jquery.com/Plugins/Autocomplete">AutoComplete</a> plugin. &nbsp;The AutoComplete component allows you to bind a data object to any input control to allow you to use autoComplete features on it. An example of how to enable this can seen below.&nbsp;</p>
<pre style="padding-top: 5px !important; padding-right: 5px !important; padding-bottom: 5px !important; padding-left: 5px !important; margin-top: 0.8em !important; margin-right: 0px !important; margin-bottom: 1.2em !important; margin-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px !important; vertical-align: baseline; background-image: initial !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: rgb(245, 244, 238) !important; color: rgb(6, 38, 60) !important; border-top-style: dotted !important; border-right-style: dotted !important; border-bottom-style: dotted !important; border-left-style: dotted !important; border-top-color: rgb(221, 221, 221) !important; border-right-color: rgb(221, 221, 221) !important; border-bottom-color: rgb(221, 221, 221) !important; border-left-color: rgb(221, 221, 221) !important; line-height: 1.6 !important; overflow-x: auto; overflow-y: auto; text-align: left; font-weight: normal; font-family: monaco, monospace; float: none; width: auto; -webkit-border-top-right-radius: 3px 3px; -webkit-border-top-left-radius: 3px 3px; -webkit-border-bottom-left-radius: 3px 3px; -webkit-border-bottom-right-radius: 3px 3px; background-position: initial initial !important; ">
var data = &quot;&quot;.split(&quot;John James Tom Cat Luke&quot;);</pre>
<pre style="padding-top: 5px !important; padding-right: 5px !important; padding-bottom: 5px !important; padding-left: 5px !important; margin-top: 0.8em !important; margin-right: 0px !important; margin-bottom: 1.2em !important; margin-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px !important; vertical-align: baseline; background-image: initial !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: rgb(245, 244, 238) !important; color: rgb(6, 38, 60) !important; border-top-style: dotted !important; border-right-style: dotted !important; border-bottom-style: dotted !important; border-left-style: dotted !important; border-top-color: rgb(221, 221, 221) !important; border-right-color: rgb(221, 221, 221) !important; border-bottom-color: rgb(221, 221, 221) !important; border-left-color: rgb(221, 221, 221) !important; line-height: 1.6 !important; overflow-x: auto; overflow-y: auto; text-align: left; font-weight: normal; font-family: monaco, monospace; float: none; width: auto; -webkit-border-top-right-radius: 3px 3px; -webkit-border-top-left-radius: 3px 3px; -webkit-border-bottom-left-radius: 3px 3px; -webkit-border-bottom-right-radius: 3px 3px; background-position: initial initial !important; ">
$(&quot;#friendSelectionInputBox&quot;).autocomplete(data);</pre>
<p>If you would like to test out the capabilities of the plugin a little further, why not take a look at the <a href="http://jquery.bassistance.de/autocomplete/demo/">demos</a> page :). You might have already guessed that what we are going to do is bind an array of data we get from the Facebook API directly to the autocomplete component. &nbsp;The first thing you&#8217;ll need to to is populate a PHP array with data from your friend&#8217;s list. Once you&#8217;re familiar with setting up Facebook API Objects, this is as simple as saying:</p>
<p>&nbsp;</p>
<pre style="padding-top: 5px !important; padding-right: 5px !important; padding-bottom: 5px !important; padding-left: 5px !important; margin-top: 0.8em !important; margin-right: 0px !important; margin-bottom: 1.2em !important; margin-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px !important; vertical-align: baseline; background-image: initial !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: rgb(245, 244, 238) !important; color: rgb(6, 38, 60) !important; border-top-style: dotted !important; border-right-style: dotted !important; border-bottom-style: dotted !important; border-left-style: dotted !important; border-top-color: rgb(221, 221, 221) !important; border-right-color: rgb(221, 221, 221) !important; border-bottom-color: rgb(221, 221, 221) !important; border-left-color: rgb(221, 221, 221) !important; line-height: 1.6 !important; overflow-x: auto; overflow-y: auto; text-align: left; font-weight: normal; font-family: monaco, monospace; float: none; width: auto; -webkit-border-top-right-radius: 3px 3px; -webkit-border-top-left-radius: 3px 3px; -webkit-border-bottom-left-radius: 3px 3px; -webkit-border-bottom-right-radius: 3px 3px; ">
$query = &quot;SELECT name, sex, pic_square FROM user  WHERE uid
IN ( SELECT uid2 FROM friend WHERE uid1= '$fb_user') &quot;;
$friends = $facebook-&gt;api_client-&gt;fql_query($query);</pre>
<p>Now that we have an arary of our friend information, the next thing we need to do is convert this to a format the autoComplete plugin can understand &#8211; namely JSON.&nbsp;</p>
<p>&nbsp;</p>
<pre style="padding-top: 5px !important; padding-right: 5px !important; padding-bottom: 5px !important; padding-left: 5px !important; margin-top: 0.8em !important; margin-right: 0px !important; margin-bottom: 1.2em !important; margin-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px !important; vertical-align: baseline; background-image: initial !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: rgb(245, 244, 238) !important; color: rgb(6, 38, 60) !important; border-top-style: dotted !important; border-right-style: dotted !important; border-bottom-style: dotted !important; border-left-style: dotted !important; border-top-color: rgb(221, 221, 221) !important; border-right-color: rgb(221, 221, 221) !important; border-bottom-color: rgb(221, 221, 221) !important; border-left-color: rgb(221, 221, 221) !important; line-height: 1.6 !important; overflow-x: auto; overflow-y: auto; text-align: left; font-weight: normal; font-family: monaco, monospace; float: none; width: auto; -webkit-border-top-right-radius: 3px 3px; -webkit-border-top-left-radius: 3px 3px; -webkit-border-bottom-left-radius: 3px 3px; -webkit-border-bottom-right-radius: 3px 3px; ">
$function generate_friend_array($facebook, $friends) {

	if (count($friends) &gt; 0 ) {
	$list_array = $facebook-&gt;api_client-&gt;users_getInfo($friends,
array('uid', 'last_name','first_name')); 

	// array sorting (friend list alphabetically)
	usort($list_array, 'cmpi');

	$return = &quot;var friend_array = []; &quot;;

	foreach ($list_array as $list_array_line) {
	$uid = $list_array_line['uid'];
	// insert slashes to escape potential ' in names
	$first_name = addslashes($list_array_line['first_name']);
	$last_name = addslashes($list_array_line['last_name']);
	$name = $first_name .&quot; &quot;. $last_name;
	$return .= &quot;

		friend_array.push(['&quot;.$uid.&quot;', '&quot;.$name.&quot;']);

	&quot;;	

	}

	return $return;
	} else {
	return &quot;var friend_array = 'none'&quot;;
	}
}</pre>
<p>&nbsp;</p>
<p>The array returned by this function should be valid JSON. For the purposes of this demo our array will only consist of your friend&#8217;s name and their UID. The last thing we <span style="font-size: medium; "><code>need to do is adjust our autoComplete component to understand the row format being output by the function.</code></span></p>
<p>&nbsp;</p>
<pre style="padding-top: 5px !important; padding-right: 5px !important; padding-bottom: 5px !important; padding-left: 5px !important; margin-top: 0.8em !important; margin-right: 0px !important; margin-bottom: 1.2em !important; margin-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px !important; vertical-align: baseline; background-image: initial !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: rgb(245, 244, 238) !important; color: rgb(6, 38, 60) !important; border-top-style: dotted !important; border-right-style: dotted !important; border-bottom-style: dotted !important; border-left-style: dotted !important; border-top-color: rgb(221, 221, 221) !important; border-right-color: rgb(221, 221, 221) !important; border-bottom-color: rgb(221, 221, 221) !important; border-left-color: rgb(221, 221, 221) !important; line-height: 1.6 !important; overflow-x: auto; overflow-y: auto; text-align: left; font-weight: normal; font-family: monaco, monospace; float: none; width: auto; -webkit-border-top-right-radius: 3px 3px; -webkit-border-top-left-radius: 3px 3px; -webkit-border-bottom-left-radius: 3px 3px; -webkit-border-bottom-right-radius: 3px 3px; ">
$(&quot;#friendSelectionInboxBox&quot;).autoComplete(emails, {
           minChars:0,
           width:310,
           matchContains:true,
           autoFill: false,
           formatItem: function (row, i, max)&nbsp;{
              return i + &quot;/&quot; + max + &quot;: \&quot;&quot; + row.name + &quot;\&quot; [&quot; + row.to + &quot;]&quot;;
           },
           formatMatch: function(row, i, max)&nbsp;{
              return row.name + &quot; &quot; + row.to;
          },
          formatResult:function (row){
              return row.to;
         }});</pre>
<p><span style="font-size: medium; ">&nbsp;</span><code>&nbsp;</code></p>
<p>And that&#8217;s it. You should now have a working friend selector :)</p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2Fhow-to-create-a-facebook-friend-selector-using-jquery-and-php-or-grails-without-fbml%2F&amp;t=How%20to%20create%20a%20Facebook%20Friend%20Selector%20using%20jQuery%20and%20PHP%20or%20Grails%20%28without%20FBML%29" id="facebook_share_button_416" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_416') || document.getElementById('facebook_share_icon_416') || document.getElementById('facebook_share_both_416') || document.getElementById('facebook_share_button_416');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_416') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/anatomy-of-a-facebook-application/' rel='bookmark' title='Permanent Link: Creating a Facebook Application &#8211; a simple guide for PHP, JavaScript, Flex and Grails developers.'>Creating a Facebook Application &#8211; a simple guide for PHP, JavaScript, Flex and Grails developers.</a> <small>&nbsp;If you&#8217;re a web developer and you haven&#8217;t explored the...</small></li><li><a href='http://blarnee.com/wp/creating-a-facebook-application-a-guide-for-php-javascript-flex-and-grails-developers/' rel='bookmark' title='Permanent Link: Creating a Facebook Application &#8211; a guide for PHP, JavaScript, Flex and Grails developers'>Creating a Facebook Application &#8211; a guide for PHP, JavaScript, Flex and Grails developers</a> <small> If you’re a web developer and you haven’t explored...</small></li><li><a href='http://blarnee.com/wp/how-to-create-impressive-animations-in-jquery-with-animate/' rel='bookmark' title='Permanent Link: How to create impressive animations in jQuery with .animate()'>How to create impressive animations in jQuery with .animate()</a> <small> I&#8217;ve been asked many times over the past month...</small></li></ol></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://blarnee.com/wp/how-to-create-a-facebook-friend-selector-using-jquery-and-php-or-grails-without-fbml/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery Playlist.com playlist downloader (Proof of concept)</title>
		<link>http://blarnee.com/wp/jquery-playlistcom-playlist-downloader-proof-of-concept/</link>
		<comments>http://blarnee.com/wp/jquery-playlistcom-playlist-downloader-proof-of-concept/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 07:44:28 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[download tracks]]></category>
		<category><![CDATA[graybox]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquery rss parsing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[playlist extractor]]></category>
		<category><![CDATA[playlist.com]]></category>
		<category><![CDATA[playlist.com API]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[podcasting]]></category>
		<category><![CDATA[stream]]></category>

		<guid isPermaLink="false">http://blarnee.com/wp/?p=142</guid>
		<description><![CDATA[ProjectPlaylist, or playlist.com as it is now known, is one of of my favorite internet start-ups. They let you create playlists containing any tracks from their huge online catalog, and over time the service has only gotten better. Recently they dropped the ability to subscribe to your playlist as a podcast which has meant that [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/how-to-add-custom-missing-image-holders-using-jquery/' rel='bookmark' title='Permanent Link: How to add custom missing image holders using jQuery'>How to add custom missing image holders using jQuery</a> <small>We&#8217;ve all experienced the dreaded &quot;red cross in a box&quot;...</small></li><li><a href='http://blarnee.com/wp/how-to-override-jquery-event-handlers/' rel='bookmark' title='Permanent Link: How to override jQuery Event Handlers'>How to override jQuery Event Handlers</a> <small>An interesting problem that I came across today was figuring...</small></li><li><a href='http://blarnee.com/wp/jquery-ui-animation-effects/' rel='bookmark' title='Permanent Link: jQuery UI Animation Effects'>jQuery UI Animation Effects</a> <small> The jQuery UI Effects Core brings a few more...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter" src="http://www.blarnee.com/images/screenshotj.jpg" alt="" /></p>
<p style="text-align: center;">
<p style="text-align: center;">ProjectPlaylist, or <strong><a href="http://www.playlist.com">playlist.com</a></strong> as it is now known, is one of of my favorite internet start-ups. They let you create playlists containing any tracks from their huge online catalog, and over time the service has only gotten better. Recently they dropped the ability to subscribe to your playlist as a podcast which has meant that users are confined to either streaming their music through <a href="http://www.microsoft.com/windows/WindowsMedia/ ">Windows Media Player</a>, or the online Flash player provided.</p>
<p style="text-align: center;">I set out to create a free third-party API to playlist.com which would provide any of the functionality that was lost. I haven&#8217;t got to the stage where the API can output playlists as valid<a href="http://www.whatisrss.com/"> RSS</a>, but to demonstrate it working I&#8217;ve setup this Playlist.com track extraction demo which allows you to see where the tracks you use on your playlist were originally hosted.</p>
<p style="text-align: center;">The tool uses PHP, jQuery and Graybox. You can access it <a href="http://blarnee.com/playlist/load.php">here</a>.</p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2Fjquery-playlistcom-playlist-downloader-proof-of-concept%2F&amp;t=jQuery%20Playlist.com%20playlist%20downloader%20%28Proof%20of%20concept%29" id="facebook_share_button_142" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_142') || document.getElementById('facebook_share_icon_142') || document.getElementById('facebook_share_both_142') || document.getElementById('facebook_share_button_142');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_142') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/how-to-add-custom-missing-image-holders-using-jquery/' rel='bookmark' title='Permanent Link: How to add custom missing image holders using jQuery'>How to add custom missing image holders using jQuery</a> <small>We&#8217;ve all experienced the dreaded &quot;red cross in a box&quot;...</small></li><li><a href='http://blarnee.com/wp/how-to-override-jquery-event-handlers/' rel='bookmark' title='Permanent Link: How to override jQuery Event Handlers'>How to override jQuery Event Handlers</a> <small>An interesting problem that I came across today was figuring...</small></li><li><a href='http://blarnee.com/wp/jquery-ui-animation-effects/' rel='bookmark' title='Permanent Link: jQuery UI Animation Effects'>jQuery UI Animation Effects</a> <small> The jQuery UI Effects Core brings a few more...</small></li></ol></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://blarnee.com/wp/jquery-playlistcom-playlist-downloader-proof-of-concept/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
