<?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>Veerasundar &#187; PHP</title>
	<atom:link href="http://veerasundar.com/blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://veerasundar.com/blog</link>
	<description>Java, web and design</description>
	<lastBuildDate>Wed, 16 May 2012 07:13:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to reset Auto Increment back to 1 in XAMPP MySQL using phpMyAdmin</title>
		<link>http://veerasundar.com/blog/2012/04/how-to-reset-auto-increment-back-to-1-in-xampp-mysql-using-phpmyadmin/</link>
		<comments>http://veerasundar.com/blog/2012/04/how-to-reset-auto-increment-back-to-1-in-xampp-mysql-using-phpmyadmin/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 11:56:04 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[id]]></category>
		<category><![CDATA[increment]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=2984</guid>
		<description><![CDATA[When you delete every records from a table, which has an AUTO Increment ID field, the delete option will not reset the Auto Increment number. For example, if the table had 5 rows, and you deleted all the rows (either one by one or through delete from tablename where 1;), and then if you insert a new [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>When you delete every records from a table, which has an AUTO Increment ID field, the <em>delete</em> option will not reset the<em> Auto Increment </em>number. For example, if the table had 5 rows, and you deleted all the rows (either one by one or through <em>delete from tablename where 1;</em>), and then if you insert a new row, it will get a ID value as <strong>6 </strong>not as <strong>1</strong>. Because the auto increment value is not reset.</p>
<p>The easiest way to reset the auto increment number is to use the query <strong>truncate tablename; </strong>which removes all the rows from that table and resets the auto increment back to 1.</p>
<p>But if you want to do it visually, phpMyAdmin provides options for that:</p>
<p style="text-align: center;"><img class="aligncenter  wp-image-2988" title="auto-increment-mysql" src="http://veerasundar.com/blog/wp-content/uploads/2012/04/auto-increment.png" alt="" width="670" height="492" /></p>
<ol>
<li>In phpMyAdmin, open the table for which you want to reset the auto increment number.</li>
<li>Then go to: <strong>Operations -&gt; Table Options. </strong></li>
<li>Reset the <strong>AUTO_INCREMENT </strong>field to whichever value you want and save the changes.</li>
</ol>
<p>That&#8217;s it. The next time, when you insert new records, they will start from the auto increment number you set above.</p>
]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2012/04/how-to-reset-auto-increment-back-to-1-in-xampp-mysql-using-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress plugin to show the posts and comments count in the sidebar</title>
		<link>http://veerasundar.com/blog/2012/03/wordpress-plugin-to-show-the-posts-and-comments-count-in-the-sidebar/</link>
		<comments>http://veerasundar.com/blog/2012/03/wordpress-plugin-to-show-the-posts-and-comments-count-in-the-sidebar/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 01:58:52 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=2926</guid>
		<description><![CDATA[As part of this blog&#8217;s re-design, I wanted to show the number of posts and comments as a widget in the sidebar. But I couldn&#8217;t find a plugin that does exactly what I wanted. So, I wrote one on my own. Below is the source code for this wordpress plug-in which you can drop it [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>As part of this blog&#8217;s re-design, I wanted to show the number of posts and comments as a widget in the sidebar. But I couldn&#8217;t find a plugin that does exactly what I wanted. So, I wrote one on my own.</p>
<p>Below is the source code for this wordpress plug-in which you can drop it in your <em>plugins </em>folder and then activate it as usual. Then, in your <em>Widgets</em> section, you&#8217;ll see a new widget that you can use it in your sidebar.</p>
<h2>Source for WordPress StatsBoard plugin to display the posts and comments count:</h2>
<script src="https://gist.github.com/1976268.js"></script>
<p>You can use the plugin however the way you want, of course, at your own risk! <img src='http://veerasundar.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2012/03/wordpress-plugin-to-show-the-posts-and-comments-count-in-the-sidebar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy way for setting up the LAMP stack in Ubuntu Linux command line</title>
		<link>http://veerasundar.com/blog/2011/10/easy-way-for-setting-up-the-lamp-stack-in-ubuntu-linux-command-line/</link>
		<comments>http://veerasundar.com/blog/2011/10/easy-way-for-setting-up-the-lamp-stack-in-ubuntu-linux-command-line/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 14:42:48 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=2687</guid>
		<description><![CDATA[Recently I got hold of an empty Rackspace server in which we have installed Ubuntu 11.04 Natty Narwhal version. My next step was to setup the LAMP stack in that server to run our PHP site. First I tried to install XAMPP for Linux. But unfortunately, it failed because XAMPP only supports 32 bit operating system [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Recently I got hold of an empty Rackspace server in which we have installed Ubuntu 11.04 Natty Narwhal version. My next step was to setup the LAMP stack in that server to run our PHP site.</p>
<p>First I tried to install XAMPP for Linux. But unfortunately, it failed because XAMPP only supports 32 bit operating system and ours was 64. I didn&#8217;t want to spend much time on fixing that issue, so I moved to setup the LAMP stack by other means.</p>
<p>Here&#8217;s what I did (after googling/referring a lot):</p>
<h2>1.Install lamp-server</h2>
<ol>
<li><strong>sudo apt-get install tasksel </strong>[installs the tasksel that helps you to install multiple packages as a single task]</li>
<li><strong>sudo tasksel install lamp-server </strong>[it will install the lamp stack in location <em>/etc/</em>]</li>
<li><em>http://yourdomain.com </em>should work now.</li>
</ol>
<h2>2. Configure PHP Curl module</h2>
<ol>
<li><strong>sudo apt-get install php5-curl </strong>[downloads and installs curl module]</li>
<li><strong>sudo /etc/init.d/apache2 restart</strong> [restarts server for the changes to take effect]</li>
</ol>
<h2>3. Install phpmyadmin</h2>
<ol>
<li><strong>sudo apt-get update </strong>[updates the packages repository. When I first tried to install phpmyadmin without updating, it complained that phpmyadmin isn't found.]</li>
<li><strong>sudo apt-get install phpmyadmin </strong>[will trigger a installation wizard]</li>
<li>Choose <strong>apache2 </strong>for the <strong>server configuration</strong> and choose <strong>no </strong>for <strong>database configuration </strong>(since we have already installed database).</li>
<li><strong>sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf.d </strong>[copies the server configuration so that it is accessible via web]</li>
<li><strong>sudo /etc/init.d/apache2 restart</strong></li>
<li><em>http://yourdomain.com/phpmyadmin</em> should work now.</li>
</ol>
<div>That&#8217;s it. Now our server is ready for serving the traffic. Place your website files under <strong>/var/www/ </strong>which will be served to the world.</div>
]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2011/10/easy-way-for-setting-up-the-lamp-stack-in-ubuntu-linux-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inserting Adsense within post content in Thesis WordPress</title>
		<link>http://veerasundar.com/blog/2010/11/inserting-adsense-within-post-content-in-thesis-wordpress/</link>
		<comments>http://veerasundar.com/blog/2010/11/inserting-adsense-within-post-content-in-thesis-wordpress/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 11:04:08 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ad]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[codex]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dollor]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[thesis]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=1975</guid>
		<description><![CDATA[The usual placement of ads in a blog post is either before the post content or after it. But, if you want to place the ads within your content, then there&#8217;s a way to do it in WordPress. This same technique works in Thesis theme too! Using wordpress filters, we can insert ads (or any [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The usual placement of ads in a blog post is either <em>before</em> the post content or <em>after </em>it. But, if you want to place the ads <em>within</em> your content, then there&#8217;s a way to do it in WordPress. This same technique works in Thesis theme too!</p>
<p>Using <strong>wordpress filters</strong>, we can insert ads (or any content you wish) within the post content. Filters are great way to modify a content. They take one input, apply the modifications and return the output. That&#8217;s what we are going to do now for your post content. We are going to put a place holder for ads in our post content and using filters we are going to replace this placeholder with Adsense.</p>
<p>Follow these steps:</p>
<ol>
<li>Get your Adsense code.</li>
<li>Open <strong>functions.php</strong> or <strong>custom_functions.php</strong> (if you are using Thesis theme) in your wordpress dashboard and add the below code (take a backup before, if you like):
<pre class="brush:php">function insertAdInPost($post_content){
  $ad='[your-Ad]';
  return str_replace("[adsense]", $ad, $post_content);
}
add_filter("the_content", "insertAdInPost");</pre>
</li>
<li>Replace the place holder &#8220;[Your-Ad]&#8221; with your adsense code and save the file.</li>
<li>Edit any post in which you want to add Adsense, and place the markup &#8220;[adsense]&#8221; where you want to insert the ad.</li>
</ol>
<p>That&#8217;s it! Your own smart Adsense, without using any plug-ins stuff!</p>
]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2010/11/inserting-adsense-within-post-content-in-thesis-wordpress/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>3 tips for effectively using Adsense in WordPress</title>
		<link>http://veerasundar.com/blog/2010/03/3-tips-for-effectively-using-adsense-in-wordpress/</link>
		<comments>http://veerasundar.com/blog/2010/03/3-tips-for-effectively-using-adsense-in-wordpress/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 13:17:18 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ad]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[monetize]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=1445</guid>
		<description><![CDATA[Adsense is one of the easy and effective way to monetize any website. I have been using Adsense ever since I started blogging and it gave me good returns too! In my last post about Adsense, I had summarized some of my observations from using Adsense to monetize this blog. Long back, I shared a [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Adsense is one of the easy and effective way to monetize any website. I have been using Adsense ever since I started blogging and it gave me <a title="Google Adsense payment recieved" href="http://veerasundar.com/blog/2009/09/google-adsense-payment-recieved/">good returns</a> too!</p>
<p>In my last post about Adsense, I had summarized some of my observations from using <a title="Adsense and my Blog" href="http://veerasundar.com/blog/2010/01/adsense-and-my-blog/">Adsense to monetize this blog</a>. Long back, I shared a PHP code snippet to <a title="Code snippet for including content based on post length in WordPress" href="http://veerasundar.com/blog/2008/08/code-snippet-for-including-content-based-on-post-length-in-wordpress/">insert Adsense based on the post length</a>. Today In this post, I&#8217;m sharing few more tips on Adsense, which I think might helpful to you. Here we go:</p>
<p class="note">I assume that you are using WordPress and you know how to edit WordPress theme files. If not, you are using these code snippets at your own risk!</p>
<h2>1. Target Adsense content and get better ads</h2>
<p>Your blog might have n-number of things &#8211; comments, sidebars, ads, etc &#8211; apart from the main content. The user comes to your site to read your <em>content,</em> not the n-number of other things. So, it is better to target the main content to show best matching ads, which in turn increase the click through rate. This is called as <strong>Adsense Section Targeting</strong>. It&#8217;s an <a title="What is section targeting and how do I implement it?" href="https://www.google.com/adsense/support/bin/answer.py?answer=23168">approved method</a> from Google to improve the advertisement shown on your website.</p>
<p>For Section targeting, all you need to do is, put the following code snippet in your blog/website.</p>
<pre class="brush:html">&lt;!-- google_ad_section_start --&gt;
Your main content / blog post.
&lt;!-- google_ad_section_end --&gt;</pre>
<p>WordPress users can add the above snippet in their <em>single.php</em> file in appropriate place.</p>
<h2>2. Show Adsense only to the search engine traffic</h2>
<p>If you want to show the advertisements only to the users who are coming from a search engine (Google or Yahoo!), use this snippet. For wordpress users, in your <em>single.php</em> file place this code in appropriate place.</p>
<pre class="brush:php">&lt;?php
$ref = $_SERVER['HTTP_REFERER'];
$SE = array('/search?', 'images.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.');
foreach ($SE as $source)
{
        if (strpos($ref,$source)!==false)
        {
                echo 'PLACE ADSENSE HERE';
        }
}
?&gt;</pre>
<h2>3. Add ad only to the older posts</h2>
<p>In case you want to show ads only on the posts which are older than, say 10 days. This way you can hide adsense to the regular readers of your blog and still show advertisement to the people who are looking at your old posts. Well, here&#8217;s the code snippet for that.</p>
<pre class="brush:php">&lt;?php
  global $post;
  $DAYDIFFERENCE = 10;
  $postDate = $post-&gt;post_date;
  $currentDate = date('Y-m-d');
  $diff = abs(strtotime($currentDate) - strtotime($postDate));
  $diff = ceil($diff/86400);
  if($diff &gt; $DAYDIFFERENCE ){
    echo 'PLACE YOUR AD HERE';
  }
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2010/03/3-tips-for-effectively-using-adsense-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Now reading &#8211; CodeIgniter 1.7 Book from Packt Publishing</title>
		<link>http://veerasundar.com/blog/2009/12/now-reading-codeigniter-1-7-book-from-packt-publishing/</link>
		<comments>http://veerasundar.com/blog/2009/12/now-reading-codeigniter-1-7-book-from-packt-publishing/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 13:37:35 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=1110</guid>
		<description><![CDATA[When you have an idea and you want to develop it as an application, you have several choices to make, like the programming language, the open source libraries, the software tools, etc. Along with these choices, it is also important to choose what framework you are going to use. Because frameworks make the development a [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>When you have an idea and you want to develop it as an application, you have several choices to make, like the programming language, the open source libraries, the software tools, etc. Along with these choices, it is also important to <strong>choose what framework</strong> you are going to use. Because frameworks make the development a lot easier and they bring some best practices, out-of-the box, into our project.</p>
<p>And, if you are a PHP programmer, then you have a tough time when it comes to <a title="Choosing a PHP framework to work with" href="http://veerasundar.com/blog/2009/01/choosing-a-php-framework-to-work-with/">choosing a PHP framework</a>. Because there are n-number of solutions out there. But very few of them stands out, in terms of easy of use, better performance and wide acceptability by programmers. No doubt that <strong><a title="CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications." href="http://codeigniter.com/">CodeIgniter</a> (CI)</strong> is one such PHP framework and that&#8217;s why I <a title="Chose a PHP framework – Codeigniter" href="http://veerasundar.com/blog/2009/01/chose-a-php-framework-codeigniter/">chose CodeIgniter</a> for my PHP development. It is MVC, light-weight, gives better performance, well documented and have a <a title="CodeIgniter Forums" href="http://codeigniter.com/forums/">great community following</a>. After using CI, I could really appreciate my decision of choosing it.</p>
<div style="float:right;margin:0 10px;"><a href="http://www.packtpub.com/improve-coding-productivity-with-codeigniter-1-7/mid/101209ohlud0?utm_source=veerasundar.com&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_001802"><img title="CodeIgniter 1.7 Book" src="http://i187.photobucket.com/albums/x201/talktoveera/codeigniter-book.png" alt="CodeIgniter 1.7 Book" width="100" height="123" /></a></div>
<p>So, to get more grip on the CodeIgniter framework, I&#8217;d started reading more materials. Currently, I&#8217;m reading the book <strong><a title="CodeIgniter 1.7 Book" href="http://www.packtpub.com/improve-coding-productivity-with-codeigniter-1-7/mid/101209ohlud0?utm_source=veerasundar.com&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_001802">CodeIgniter 1.7</a></strong> by <em>Jose Argudo Blanco</em> and <em>David Upton</em>. The book claims to improve the PHP coding productivity with CodeIgniter framework. It explains how to use CodeIgniter framework in a better way. Rather than explaining the syntax and rules of CodeIgniter, this book focuses on getting the big picture and ideas on how to use CodeIgniter. Here&#8217;s the link to the sample chapter if you are interested : <a title="CodeIgniter 1.7 - Sample Chapter" href="http://www.packtpub.com/files/9485-codeigniter-1-7-sample-chapter-3-%20navigating-your-site.pdf">CodeIgniter 1.7 Book &#8211; Sample Chapter &#8211; Navigating Your Website</a></p>
<p>This book has around 300 pages, so I guess I might take a week to read it completely. I&#8217;ll probably write a review of this book once I done with reading it. So, till then enjoy PHP coding with CI!</p>
]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2009/12/now-reading-codeigniter-1-7-book-from-packt-publishing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ignited PHP development with CodeIgniter</title>
		<link>http://veerasundar.com/blog/2009/10/ignited-php-development-with-codeigniter/</link>
		<comments>http://veerasundar.com/blog/2009/10/ignited-php-development-with-codeigniter/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 17:29:03 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[framework]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=871</guid>
		<description><![CDATA[If you were diligently following my blog for some time, I hope you must have read my earlier post about PHP Development with CodeIgniter. I wrote that post a long back, to say exactly, 10 months back. I was planning for a series on CodeIgniter, but had to stop with just one post, due to [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>If you were diligently following my blog for some time, I hope you must have read my earlier post about <a title="PHP development with CodeIgniter : Getting Started [1]" href="http://veerasundar.com/blog/2009/01/php-development-with-codeigniter-getting-started-1/">PHP Development with CodeIgniter</a>. I wrote that post a long back, to say exactly, 10 months back. I was planning for a series on CodeIgniter, but had to stop with just one post, due to my official workload. After that I didn&#8217;t get much time to visit that article, until last week.</p>
<p>When I asked for a <a title="Best PHP framework to work with" href="http://veerasundar.com/blog/2009/01/choosing-a-php-framework-to-work-with/">best PHP framework</a>, I got mixed views on various PHP frameworks, such as <a title="CakePHP - PHP framework" href="http://cakephp.org/">CakePHP</a>, <a title="Zend - PHP Framework" href="http://framework.zend.com/">Zend</a>, <a title="Symfony - PHP framework" href="http://www.symfony-project.org/">Symfony</a>, etc. But, later I <a title="CodeIgniter framework" href="http://veerasundar.com/blog/2009/01/chose-a-php-framework-codeigniter/">chose CodeIgniter</a> mainly because of it&#8217;s very <a title="CodeIgniter documentation" href="http://codeigniter.com/user_guide/">detailed documentation</a>. I was new to PHP then, so the detailed documentation of CodeIgniter helped me to get started quickly with PHP development.</p>
<p>So, enough of CI praising. Just wanted to say that I again started with my PHP side project. Needless to say, I&#8217;m building this app using CodeIgniter framework and I&#8217;m enjoying the every bit of the development. Will be announcing about my project, soon once it&#8217;s in some shape. And, i&#8217;ll be restarting the CodeIgniter post series, too. So, <a href="http://veerasundar.com/blog/feed">keep watching</a> this blog!</p>
]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2009/10/ignited-php-development-with-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP development with CodeIgniter : Getting Started [1]</title>
		<link>http://veerasundar.com/blog/2009/01/php-development-with-codeigniter-getting-started-1/</link>
		<comments>http://veerasundar.com/blog/2009/01/php-development-with-codeigniter-getting-started-1/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 15:16:27 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=314</guid>
		<description><![CDATA[As I&#8217;ve already said here, I&#8217;ve started using CodeIgniter for my application development.I will be documenting what ever I learn during this development as a series of blog posts. The first post in this series will be Getting Started with PHP development. Setting up the PHP development environment Before starting the development, we need to [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>As I&#8217;ve already <a title="chose a php framework" href="http://veerasundar.com/blog/2009/01/11/chose-a-php-framework-codeigniter/">said here</a>, I&#8217;ve started using <a title="codeigniter" href="http://codeigniter.com/" target="_blank">CodeIgniter</a> for my application development.I will be documenting what ever I learn during this development as a series of blog posts. The first post in this series will be <strong>Getting Started with PHP development</strong>.</p>
<h3>Setting up the PHP development environment</h3>
<p>Before starting the development, we need to setup the development environment first. Either we could install PHP, Database and web server software seperately or we can use the packaged applications which comes with all the required software built in a single software.</p>
<p><a title="XAMPP" href="http://en.wikipedia.org/wiki/XAMPP" target="_blank">XAMPP</a> is such a software which contains Apache, MySQL, PHP and Perl and is great to quickly start with the development. Get XAMPP from <a title="XAMPP server" href="http://www.apachefriends.org/en/xampp.html" target="_blank">its website</a>. By default XAMPP installs in <strong>C:xampp</strong> folder. To start using the XAMPP server, open the &#8220;xampp-control&#8221; application and start the Apache and MySQL servers from the control panel.</p>
<h4>Configuring XAMPP server:</h4>
<p>After installing XAMPP server, it will be better if we could do little security changes in the Apache server. By default, the Apache server is visible to anyone in the network. To avoid this and make the Apache only visible to the local machine, we need to modify the <em>[xampp]/apache</em>/conf/<em>httpd.conf</em> file as below:</p>
<pre class="brush:xml">&lt;Directory "c:/xampp/htdocs"&gt;
...
Allow from all
&lt;/Directory&gt;</pre>
<p>to</p>
<pre class="brush:xml">&lt;Directory "c:/xampp/htdocs"&gt;
...
Allow from 127.0.0.1
&lt;/Directory&gt;</pre>
<p>After this change, search for the string <strong>Listen 80</strong> in the <em>httpd.conf</em> file and change the string to <strong>Listen 127.0.0.1:80.</strong> This will ensure that Apache is only available for the local machine.</p>
<p>Also, it is recomended to <a title="How to change the ‘root’ password for MySQL in XAMPP?" href="http://veerasundar.com/blog/2009/01/03/how-to-change-the-root-password-for-mysql-in-xampp/">change the MySQL server&#8217;s root user password</a>, because by default MySQL server installed with no password for the root user.</p>
<h4>PHP Development IDE:</h4>
<p>A simple <a title="Notepad++" href="http://notepad-plus.sourceforge.net/uk/site.htm" target="_blank">Notepad++</a> will do for the PHP development. But if you need more features like debugging and code help, then <a title="Download Eclipse PDT IDE" href="http://download.eclipse.org/tools/pdt/downloads/" target="_blank">Eclipse PDT</a> would be a good option. One more advantage in using an IDE is we can also dubug PHP applications from the IDE itself, which will not be possible if we just use a text editor.</p>
<p>In the next part of this series, I will be explaining how to install and configure CodeIgniter framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2009/01/php-development-with-codeigniter-getting-started-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using wordpress custom fields to control Ads in your blog</title>
		<link>http://veerasundar.com/blog/2008/10/using-wordpress-custom-fields-to-control-ads-in-your-blog/</link>
		<comments>http://veerasundar.com/blog/2008/10/using-wordpress-custom-fields-to-control-ads-in-your-blog/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 06:33:11 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=67</guid>
		<description><![CDATA[Custom fields are the user defined information that are assigned to any blog post in WordPress. They are also called as meta-data. Blog authors usually define the custom fields when they write the blog post to give some extra information like mood, whether,etc. Custom fields are key/value pairs, that means you can define any key [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Custom fields are the user defined information that are assigned to any blog post in WordPress. They are also called as <strong>meta-data</strong>. Blog authors usually define the custom fields when they write the blog post to give some extra information like mood, whether,etc. Custom fields are <strong>key/value</strong> pairs, that means you can define any key and assign any value to this key. To know more about custom fields check out <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">WordPress.org</a> site. With this explanation, it is easy to control the ad presence in your blog post easily with custom fields.<br />
<span id="more-67"></span></p>
<h3>Control ad presence in blog post with custom fields</h3>
<p>As a blog author, you may want to include ad in some of your blog posts and may not want to have ads in other blogs. But it will be tedious to make a code change every time you post a blog. So we are going to define a custom field <code>$show_ad</code> and in the blog template we will check for this custom field. And, if it is YES we will include the advertisement and if it is NO or NULL we are not going to insert the advertisement.</p>
<h3>Code changes to check for a custom field</h3>
<ol>
<li>Open the <em>single.php</em> wordpress template file</li>
<li>Search for the text <code>the_content</code> and after this line, insert the below code. This will put the advertisement in the bottom of every post. If you want to place your ad on top of every post, copy below code above to the <code>the_content</code> line.</li>
<li><em>Code to be inserted</em>
<pre class="brush:php">&lt;?php
	$show_ad=get_post_meta($post-&gt;ID, 'show_ad',TRUE);
	if (strtoupper($show_ad) == "YES")
	{
		echo 'YOUR AD CODE IS HERE';
	}
?&gt;
</pre>
</li>
<li>Save the changes.</li>
<li>After this, when ever you want to insert ad in your blog post, just define a custom field <code>show_ad</code> and give it a value &#8220;YES&#8221;. Your ad code will be inserted to this post alone. If you don&#8217;t want to insert ad, just don&#8217;t define any custom fields. So simple, isn&#8217;t it?</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2008/10/using-wordpress-custom-fields-to-control-ads-in-your-blog/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Code snippet for including content based on post length in WordPress</title>
		<link>http://veerasundar.com/blog/2008/08/code-snippet-for-including-content-based-on-post-length-in-wordpress/</link>
		<comments>http://veerasundar.com/blog/2008/08/code-snippet-for-including-content-based-on-post-length-in-wordpress/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 15:47:57 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/2008/08/11/code-snippet-for-including-content-based-on-post-length-in-wordpress/</guid>
		<description><![CDATA[If you are using WordPress publishing platform for your blog, you will find this code snippet useful. In some situations, you may want to add some content (advertisements, images,etc) to your blog post, only if your post length reaches certain number of words. In my case, I wanted to include Ads after my blog posts, [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>If you are using WordPress publishing platform for your blog, you will find this code snippet useful. In some situations, you may want to add some content (advertisements, images,etc) to your blog post, only if your post length reaches certain number of words. In my case, I wanted to include Ads after my blog posts, only if the post has at least 100 words. I do not want to add advertisement for small posts. Below is the code snippet to achieve this.</p>
<p><strong>Important:</strong><br />
This code snippet is dependent on <a href="http://www.murraywilliams.com/software/word-count-plugin-for-wordpress/">Word count plug-in for WordPress</a> created by <a href="http://www.murraywilliams.com/">Murray</a>. You need to include this plug-in in your WordPress installation, before using the below code snippet. You can check the plug-in site for installation instructions.</p>
<p><strong>Code snippet for including content based on post lenght:</strong><br />
For this code snippet, I assume you are including it in &#8220;<em>single.php</em>&#8221; file. Open the &#8220;single.php&#8221; file and add below code after <code>&lt;?php the_content('» Read the rest of the entry.. ') ?&gt;</code></p>
<p><strong>Code to include:</strong></p>
<pre class="brush:php">

&lt;?php
  if (function_exists('mtw_wordcount'))
  {
    // Number of words to check for
    $PostLengthToCheck = 100;

    // Get the post length by calling the function mtw_wordcount.
    // This function returns the number of words in a blog post.
    $postLength = mtw_wordcount();
    if ($postLength &gt; $PostLengthToCheck)
    {
      //Add the content inide the quotes of echo statement.
      // Content may be anything.
      echo 'Your Content goes here';
    }
  }
?&gt;</pre>
<p>I hope the above code snippet will be useful to WordPress bloggers. Let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2008/08/code-snippet-for-including-content-based-on-post-length-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

