<?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>IT Geek! &#187; PHP</title>
	<atom:link href="http://itgeek.in/category/php/feed" rel="self" type="application/rss+xml" />
	<link>http://itgeek.in</link>
	<description>the geek life of a Web Developer and Hobbiest Photographer</description>
	<lastBuildDate>Sun, 04 Jul 2010 18:29:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Reading Excel Spreadsheets with PHP</title>
		<link>http://itgeek.in/php/reading-excel-spreadsheets-with-php.html</link>
		<comments>http://itgeek.in/php/reading-excel-spreadsheets-with-php.html#comments</comments>
		<pubDate>Mon, 22 Jun 2009 17:43:41 +0000</pubDate>
		<dc:creator>Charandeep Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[phpexcelreader]]></category>
		<category><![CDATA[spreadsheet]]></category>

		<guid isPermaLink="false">http://itgeek.in/?p=249</guid>
		<description><![CDATA[PHP is yet most powerful language when it comes to deal with different data formats like SQL Results, XML Files etc. To improve the functionality of PHP, we use extensions. There are many extensions/packages which let us to read more different types of data formats. Today, we will be using one of them, i.e. phpexcelreader.
PHPExcelReader [...]]]></description>
			<content:encoded><![CDATA[<p>PHP is yet most powerful language when it comes to deal with different data formats like SQL Results, XML Files etc. To improve the functionality of PHP, we use extensions. There are many extensions/packages which let us to read more different types of data formats. Today, we will be using one of them, i.e. <a href="http://sourceforge.net/projects/phpexcelreader/" target="_blank">phpexcelreader</a>.</p>
<p>PHPExcelReader comes with two files <em>oleread.inc</em> and <em>reader.php</em>. We will need to include <em>reader.php</em> in order to use the package. For the sake of &#8220;simplicity&#8221;, I have made some changes in example file and data. Grab it here:<span id="more-249"></span></p>
<p align="center"><a href="http://itgeek.in/wp-content/uploads/2009/06/phpexcelreader.zip">Dowload PHPExcelReader.zip</a></p>
<p align="center">Sample Excel Spreadsheet<br/>

			    <a href="http://itgeek.in/wp-content/uploads/2009/06/excel1.jpg" class="highslide"  onclick="return hs.expand(this, {captionId: 'caption-for-P2490'})"> 
                <img src="http://itgeek.in/wp-content/uploads/2009/06/excel1-300x218.jpg" alt="Sample Excel Spreadsheet" border="0" id="P2490" title="Sample Excel Spreadsheet" /></a> 
								<div class='highslide-caption' id='caption-for-P2490'>
			       		
	     				    	<a href="#" onclick="hs.close(this)" class="highslide-close">Close</a>   	
				<div style="clear:both">Sample Excel Spreadsheet</div>
	
			    </div>

</p>
<p>Take a look at <em>example.php</em>, code is pretty much straight forward. As I said before, in order to use the package we need to include <em>reader.php</em> into our code.<br />
<code>require_once('excel/reader.php');</code><br />
Next, create a new object from the class <em>Spreadsheet_Excel_Reader</em> and give the excel file which you like to read.<br />
<code><br />
$xls = new Spreadsheet_Excel_Reader();<br />
$xls->read('indiastamps_yearsets.xls');<br />
</code><br />
All the rows and columns can be accessed through array variable <em>sheets</em>. We use two <em>for</em> loops to access each and every element of the sheet0.<br />
<code>$xls->sheets[0]['cells'][$row][$column]</code></p>
<p align="center">Result<br/>

			    <a href="http://itgeek.in/wp-content/uploads/2009/06/excel2.jpg" class="highslide"  onclick="return hs.expand(this, {captionId: 'caption-for-P2491'})"> 
                <img src="http://itgeek.in/wp-content/uploads/2009/06/excel2-272x300.jpg" alt="Result" border="0" id="P2491" title="Result" /></a> 
								<div class='highslide-caption' id='caption-for-P2491'>
			       		
	     				    	<a href="#" onclick="hs.close(this)" class="highslide-close">Close</a>   	
				<div style="clear:both">Result</div>
	
			    </div>

</p>
<p>If you are Microsoft Excel 2007 user, be sure about saving file in 1997-2003 .xls format else it will not work. Thanks for reading. <img src='http://itgeek.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://itgeek.in/php/reading-excel-spreadsheets-with-php.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CurrentStatus Wordpress Plugin</title>
		<link>http://itgeek.in/php/currentstatus-wordpress-plugin.html</link>
		<comments>http://itgeek.in/php/currentstatus-wordpress-plugin.html#comments</comments>
		<pubDate>Thu, 04 Jun 2009 12:53:40 +0000</pubDate>
		<dc:creator>Charandeep Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[adminpanel]]></category>
		<category><![CDATA[currentstatus]]></category>
		<category><![CDATA[mood]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[wordpressplugin]]></category>
		<category><![CDATA[wpplugin]]></category>

		<guid isPermaLink="false">http://itgeek.in/?p=180</guid>
		<description><![CDATA[As you may have noticed a little box on the left sidebar of my blog home page(currently not available), which displays my current status and mood. While creating this blog, I came to know that it is good to have your current status on blog, so if you not going to post any new stuff, [...]]]></description>
			<content:encoded><![CDATA[<p>As you may have noticed a little box on the left sidebar of my blog <a href="http://itgeek.in/">home page</a><i>(currently not available)</i>, which displays my current status and mood. While creating this blog, I came to know that it is good to have your current status on blog, so if you not going to post any new stuff, you can tell to your reader that to you are going to have a break now. <img src='http://itgeek.in/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So, I searched for related plugin, but didn&#8217;t quite get the exact thing I want. Then decide to make one new on my own. This is my first try on wordpress plugin, so I want to share it here, hope folks found it usefull.</p>
<p>Firstly, <a href="http://itgeek.in/wp-content/uploads/2009/06/currentstatus-10.zip">Download the CurrentStatus plugin from here</a>. Unpack it and upload the directory <em>currentstatus</em> to your wordpress plugin directory (wp-contents/plugin/).<span id="more-180"></span> Activate the plugin from admin panel of your blog. Now you can see another option added on your settings options <em>i.e. CurrentStatus</em></p>
<p align="center"><img src="http://itgeek.in/wp-content/uploads/2009/06/currentstatus.jpg" /></p>
<p>Now you have to add a little code somewhere in your wordpress theme, where you would like to display your status. As I display on my sidebar, open <em>sidebar.php</em> for editing. Add the following code, where you want to display your status.<br />
<code>&lt;?php echo CurrentStatus_GetCurrentStatus(); ?&gt;</code><br />
That&#8217;s all, We&#8217;re done now. To change the Status and Mood, click on the CurrentStatus under Settings in your admin panel. You will see admin panel of the CurrentStatus Plugin.</p>
<p align="center"><img src="http://itgeek.in/wp-content/uploads/2009/06/currentstatus_admin.jpg" /></p>
<p>Enter your status in text field and choose any mood from the list of 155 different moods. You can also edit the structure of how your status will be inserted. Noted that %STATUS% is replaced by status and %MOOD% is replaced by mood selected, remaining code as it is inserted, where we add our code in <em>sidebar.php</em>. At the end, don&#8217;t forget to hit &#8220;Update&#8221; button to apply changes. <img src='http://itgeek.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://itgeek.in/php/currentstatus-wordpress-plugin.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Track Geolocation of visitors: PHP and IP-to-Country Database</title>
		<link>http://itgeek.in/php/track-geolocation-of-visitors-php-and-ip-to-country-database.html</link>
		<comments>http://itgeek.in/php/track-geolocation-of-visitors-php-and-ip-to-country-database.html#comments</comments>
		<pubDate>Wed, 03 Jun 2009 17:28:12 +0000</pubDate>
		<dc:creator>Charandeep Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[bloggers]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[ip address]]></category>
		<category><![CDATA[ip number]]></category>
		<category><![CDATA[iplocator]]></category>
		<category><![CDATA[iptocountry]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[statcounter]]></category>
		<category><![CDATA[track ip]]></category>
		<category><![CDATA[webmasters]]></category>

		<guid isPermaLink="false">http://itgeek.in/?p=147</guid>
		<description><![CDATA[Geolocation is a geographical location of peer computer connected with some network i.e. local, or internet. That location can be anywhere in the world. When a computer gets connected to any network, a unique IP address is allocated and assigned to it, which uniquely identifies its identity on that network. IP address is a 32-bit [...]]]></description>
			<content:encoded><![CDATA[<p>Geolocation is a geographical location of peer computer connected with some network <em>i.e. local, or internet</em>. That location can be anywhere in the world. When a computer gets connected to any network, a unique IP address is allocated and assigned to it, which uniquely identifies its identity on that network. IP address is a 32-bit number which is divided into 4 sections, each section is separated with a dot, and contain any number from 0-255. An IP address is very sensitive and complex to grab it all. It contains all the required information like <em>network, location, host</em> of the computer.</p>
<p>Webmasters and Bloggers are always interested to see whom visiting there site, where they came from, etc. There are some free tools on web to track your visitors. <a href="http://www.google.com/analytics/" target="_blank">Google Analytics</a> and <a href="http://www.statcounter.com" target="_blank">Statcounter</a> are two most popular and accurate tools for visitor tracking. They extract information like region, city, country, referral, ISP, etc from an IP address and provide us processed information in form of graphical components like chart, graphs and pie.</p>
<p>If you are interested to make such tool or you want to use it in your own way, here is the procedure to do it.  <span id="more-147"></span></p>
<p>In this tutorial, I&#8217;ll be assuming that you have little knowledge of PHP.<br />
First of all, download the latest IP-to-Country CSV format database from <a href="http://ip-to-country.webhosting.info/node/view/6" target="_blank">here</a>. CSV file consist of 5 fields begin IP number, ending IP number, 2-digit country code, 3-digit country code and country name. Eg.<br />
<code>"33996344","33996351","GB","GBR","UNITED KINGDOM"<br />
"50331648","69956103","US","USA","UNITED STATES"<br />
"69956104","69956111","BM","BMU","BERMUDA"</code><br />
The range of record in which IP number will lies, that record will contain the other information like country name. Now, What is an IP number ? Is this same as the IP address. No, IP number is a number which is extracted from the IP address using a following formula, lets have a example if we have an IP address a.b.c.d, formula would be:<br />
<code>$ip_number = a x 16777216 + b x 65536 + c x 256 + d;</code></p>
<p>Well, we have discussed how it will work, now we will get to real stuff Lets! code it!</p>
<p><a href="http://itgeek.in/wp-content/uploads/2009/06/iplocator-10.zip">Download IP Locator 1.0</a>, IP Locator is a small package, which allows programmer to use only just one function <em>i.e. GetField();</em> for all the required operations.</p>
<p>Firstly include <em>csv.php</em> in your code:<br />
<code>require_once ('csv.php');</code></p>
<p>Below code shows three different ways of using <em>GetField()</em> function:<br />
<code>$two_digit_code = GetField('twodigitcode');<br />
$three_digit_code = GetField('threedigitcode');<br />
$country = GetField('country');</code><br />
An example <em>index.php</em> is included to package, which shows the use of IP Locator in detail. Also noted that CSV database is split into 7 different files, for the faster processing and reduce the server load. Package contain the IP-to-Country database from <a href="http://ip-to-country.webhosting.info/">http://ip-to-country.webhosting.info/</a> and the flags from <a href="http://www.ip2location.com/flagsoftheworld.aspx">www.ip2location.com</a>.</p>
<blockquote><p><b>Note:</b> IPLocator v2.0 is available which now detects city, country, latitude, longitude, browser, OS etc and locate the user location in Google Maps. See the <a href="http://itgeek.in/tools/iplocator">demo here</a>. If you wish to buy this, contact me <a href="mailto:hireitgeek@gmail.com">hireitgeek@gmail.com</a>.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://itgeek.in/php/track-geolocation-of-visitors-php-and-ip-to-country-database.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
